String
String Methods
- capitalize()
- center(width[, fillchar])
- count(sub[, start[, end]])
- decode()
- encode([encoding[, errors]])
- endswith(suffix[, start[, end]])
- expandtabs([tabsize])
- find(sub[, start[, end]])
- format(*args, **kwargs)
- index(sub[, start[, end]])
- isalnum()
- isalpha()
- isdecimal()
- isdigit()
- islower()
- isnumeric()
- isspace()
- istitle()
- isupper()
- join(iterable)
- ljust(width[, fillchar])
- lower()
- lstrip([chars])
- partition(sep)
- replace(old, new[, count])
- rfind(sub[, start[, end]])
- rindex(sub[, start[, end]])
- rjust(width[, fillchar])
- rpartition(sep)
- rsplit([sep[, maxsplit]])
- rstrip([chars])
- split([sep[, maxsplit]])
- splitlines([keepends])
- startswith(prefix[, start[, end]])
- strip([chars])
- swapcase
- title()
- translate(table[, deletechars])
- upper()
- zfill(width)
File
Methods
Set & Mapping
Set Types
Date Time
Date Object
Datetime Object
Array
Array Methods
Math
Number Theoretic
Trigonometric Functions
Angular Conversion
Random
Functions
- betavariate(alpha,beta)
- choice(seq)
- expovariate(lambd)
- gammavariate(alpha,beta)
- gauss(mu,sigma)
- getrandbits(k)
- getstate()
- jumpahead(n)
- lognormvariate(mu,sigma)
- normalvariate(mu,sigma)
- paretovariate(alpha)
- randint(a,b)
- random()
- randrange([start], stop[, step])
- sample(population,k)
- seed([x])
- setstate(state)
- shuffle(x[,random])
- triangular(low,high,mode)
- uniform(x,y)
- vonmisesvariate(mu,kappa)
- weibullvariate(alpha,beta)
Sys
Sys Variables
- argv
- Command line args
- builtin_module_names
- Linked C modules
- byteorder
- Native byte order
- check_-interval
- Signal check frequency
- exec_prefix
- Root directory
- executable
- Name of executable
- exitfunc
- Exit function name
- modules
- Loaded modules
- path
- Search path
- platform
- Current platform
- stdin, stdout, stderr
- File objects for I/O
- version_info
- Python version info
- winver
- Version number
sys.argv
- --h
- -c
- bar
- foo.py
- qux
- sys.argv[0]
- 表示命令名。
- sys.argv[1]
- 表示第一个命令行参数。
- sys.argv[2]
- 表示第二个命令行参数。
- sys.argv[3]
- 表示第三个命令行参数。
- sys.argv[4]
- 表示第四个命令行参数。
OS
Class
Special Methods
- __call__(self, args, kwargs)
- __cmp__(self, other)
- 对象比较
- __del__(self)
- 析构方法, 删除一个对象
- __delattr__(self, name)
- __eq__(self, other)
- __ge__(self, other)
- __getattr__(self, name)
- __getattribute__(self, name)
- __gt__(self, other)
- __hash__(self)
- __index__(self)
- __init__(self, args)
- 构造函数
- __le__(self, other)
- __lt__(self, other)
- __ne__(self, other)
- __new__(cls)
- __nonzero__(self)
- __repr__(self)
- 转化为供解释器读取的形式
- __setattr__(self, name, attr)
- __str__(self)
- 用于将值转化为适于人阅读的形式