SMERTH
Full-stack Web Developer
building with
100%
re-cycled electrons.
Menu
Hello
Projects
Notes
Screenshots
About
Timeline
Python the Basics
Notebook by Smerth
Chapter 1
Python
1.1
Resources
1.2
Installing Python
1.3
Running Python
1.4
Quick Check
Chapter 2
Variables
2.1
Variable Names
2.2
Declare a variable and initialize it
2.3
Re-declare a variable
2.4
Combine like type
2.5
Global vs. local variables in functions
Chapter 3
Functions
3.1
define a function
3.2
function that takes arguments
3.3
function that returns a value
3.4
function with default value for an argument
3.5
function with variable number of arguments
Chapter 4
Conditionals
4.1
conditional flow uses if, elif, else
4.2
conditional statements let you use "a if C else b"
Chapter 5
Loops
5.1
define a while loop
5.2
define a for loop
5.3
use a for loop over a collection
5.4
use the break and continue statements
5.5
using the enumerate() function to get index
Chapter 6
Classes
6.1
Inheritance
Chapter 7
Dates
Chapter 8
Formatting
8.1
Date Formatting
8.2
Time formatting
Chapter 9
Timedeltas
9.1
timedelta basics
9.2
timedelta and arguments
9.3
calculate the date 1 week ago, formatted as a string
9.4
How many days until April Fools' Day?
Chapter 10
Calendars
10.1
Creating Calendars
10.2
loop over the days of a month
10.3
Calendar locale
10.4
Calculate days based on a rule
Chapter 11
Files
11.1
Open/Create a file for writing
11.2
Open the file for appending
11.3
Append text and close
11.4
Open file and read contents
11.5
Open file and read lines to list
Chapter 12
Path utilities
12.1
Print the name of the OS
12.2
Check for item existence and type
12.3
Work with file paths
12.4
Get the modification time
12.5
Calculate how long ago the item was modified
Chapter 13
shell
13.1
make a duplicate of an existing file
13.2
separate the path part from the filename
13.3
make a backup copy of a file
13.4
copy over the permissions, etc.
13.5
rename the original file
13.6
put things into a ZIP archive
13.7
more control over ZIP files
13.8
Entire script
Chapter 14
Internet Data
14.1
Connect to URL
Chapter 15
JSON data
15.1
The Source
15.2
Fetch the JSON data
15.3
Write a Function to Process JSON
15.4
Complete script
Chapter 16
HTML
16.1
Parsing an HTML document
16.2
Open an HTML File
16.3
Make MyHTMLParser a sub-class of HTMLParser
16.4
Handle HTML Comments
16.5
Override more methods of the base class
16.6
Count the meta-tags in the head