String Methods
Datetime Methods
capitalize() *
lstrip()
today()
fromordinal(ordinal)
builtin_module_names Linked C modules
center(width)
partition(sep)
now(timezoneinfo)
combine(date, time)
byteorder
Native byte order
count(sub, start, end)
replace(old, new)
utcnow()
strptime(date, format)
check_interval
Signal check frequency
decode()
rfind(sub, start ,end)
fromtimestamp(timestamp) utcfromtimestamp(timestamp) argv
Command line args
exec_prefix
Root directory
encode()
rindex(sub, start, end)
executable
Name of executable
endswith(sub)
rjust(width)
exitfunc
Exit function name
expandtabs()
rpartition(sep)
modules
Loaded modules
find(sub, start, end) rsplit(sep)
path
Search path
index(sub, start, end)
rstrip()
replace()
utcoffset()
platform
Current platform
isalnum() *
split(sep)
isoformat()
dst()
stdin, stdout, stderr
File objects for I/O
isalpha() *
splitlines()
__str__()
tzname()
version_info
Python version info
isdigit() *
startswith(sub)
strftime(format)
winver
Version number
islower() *
strip()
isspace() *
swapcase() *
istitle() *
title() *
sys.argv for $ python foo.py bar -c qux --h
Time Methods
Date Formatting (strftime and strptime)
isupper() *
translate(table)
%a Abbreviated weekday (Sun)
foo.py
join()
upper() *
%A Weekday (Sunday)
sys.argv[1]
bar
ljust(width)
zfill(width)
sys.argv[2]
-c
lower() *
sys.argv[0]
sys.argv[3]
qux
sys.argv[4]
--h
%b Abbreviated month name (Jan)
%B Month name (January)
%c Date and time
Note
Methods marked * are locale dependant for 8-bit strings.
%d Day (leading zeros) (01 to 31)
%H 24 hour (leading zeros) (00 to 23)
%I 12 hour (leading zeros) (01 to 12)
os Variables
%j
List Methods
Day of year (001 to 366)
altsep
Alternative sep
curdir
Current dir string
append(item)
pop(position)
defpath
Default search path
count(item)
remove(item)
%p AM or PM
devnull
Path of null device
extend(list)
reverse()
%S