Python参考手册
Python 是一种面向对象的解释型计算机程序设计语言,由荷兰人 Guido van Rossum 于1989年发明,第一个公开发行版发行于1991年。 Python 是纯粹的自由软件, 源代码和解释器 CPython 遵循 GPL 协议。Python 语法简洁清晰,特色之一是强制用空白符( white space )作为语句缩进。
内置常量 | Built-in Constants | ||
---|---|---|
Constants | 详细 |
内置例外 | Built-in Exceptions | ||
---|---|---|
Exceptions | 详细 |
内置函数 | Built-in Functions | ||
---|---|---|
Functions | 详细 |
编译器 | Compiler | ||
---|---|---|
Python compiler package | 详细 |
加密 | Cryptography | ||
---|---|---|
hashlib | 详细 | |
hmac | 详细 | |
md5 | 详细 | |
sha | 详细 |
数据压缩 | Data Compression | ||
---|---|---|
bz2 | 详细 | |
gzip | 详细 | |
tarfile | 详细 | |
zipfile | 详细 | |
zlib | 详细 |
数据持久性 | Data Persistence | ||
---|---|---|
anydbm | 详细 | |
bsddb | 详细 | |
copy_reg | 详细 | |
dbhash | 详细 | |
dbm | 详细 | |
dumbdbm | 详细 | |
gdbm | 详细 | |
marshal | 详细 | |
pickle | 详细 | |
shelve | 详细 | |
sqlite3 | 详细 | |
whichdb | 详细 |
数据类型 | Data Types | ||
---|---|---|
array | 详细 | |
bisect | 详细 | |
calendar | 详细 | |
collections | 详细 | |
copy | 详细 | |
datetime | 详细 | |
heapq | 详细 | |
mutex | 详细 | |
new | 详细 | |
pprint | 详细 | |
Queue | 详细 | |
repr | 详细 | |
sched | 详细 | |
sets | 详细 | |
types | 详细 | |
UserDict | 详细 | |
weakref | 详细 |
调试和分析 | Debugging & Profiling | ||
---|---|---|
bdb | 详细 | |
hotshot | 详细 | |
pdb | 详细 | |
The Python Profilers | 详细 | |
timeit | 详细 | |
trace | 详细 |
开发工具 | Development Tools | ||
---|---|---|
doctest | 详细 | |
pydoc | 详细 | |
test | 详细 | |
unittest | 详细 |
文件和目录访问 | File & Directory Access | ||
---|---|---|
dircache | 详细 | |
File and Directory Access | 详细 | |
filecmp | 详细 | |
fileinput | 详细 | |
fnmatch | 详细 | |
glob | 详细 | |
linecache | 详细 | |
macpath | 详细 | |
os.path | 详细 | |
shutil | 详细 | |
stat | 详细 | |
statvfs | 详细 | |
tempfile | 详细 |
文件格式 | File Formats | ||
---|---|---|
ConfigParser | 详细 | |
csv | 详细 | |
netrc | 详细 | |
plistlib | 详细 | |
robotparser | 详细 | |
xdrlib | 详细 |
构架 | Frameworks | ||
---|---|---|
cmd | 详细 | |
shlex | 详细 |
输入 | Importing | ||
---|---|---|
imp | 详细 | |
importlib | 详细 | |
imputil | 详细 | |
modulefinder | 详细 | |
pkgutil | 详细 | |
runpy | 详细 | |
zipimport | 详细 |
输入/输出 | Input/ouput | ||
---|---|---|
select | 详细 |
国际化 | Internationalization | ||
---|---|---|
gettext | 详细 | |
locale | 详细 |
翻译 | Interpreters | ||
---|---|---|
code | 详细 | |
codeop | 详细 |
语言 | Language | ||
---|---|---|
ast | 详细 | |
compileall | 详细 | |
dis | 详细 | |
keyword | 详细 | |
parser | 详细 | |
pickletools | 详细 | |
pyclbr | 详细 | |
py_compile | 详细 | |
symbol | 详细 | |
symtable | 详细 | |
tabnanny | 详细 | |
token | 详细 | |
tokenize | 详细 |
记录 | Logging | ||
---|---|---|
logging | 详细 | |
logging.config | 详细 | |
logging.handlers | 详细 |
MS Windows | ||
---|---|---|
msilib | 详细 | |
msvcrt | 详细 | |
winsound | 详细 | |
_winreg | 详细 |
多媒体 | Multimedia | ||
---|---|---|
aifc | 详细 | |
audioop | 详细 | |
chunk | 详细 | |
colorsys | 详细 | |
imageop | 详细 | |
imghdr | 详细 | |
ossaudiodev | 详细 | |
sndhdr | 详细 | |
wave | 详细 |
联网 | Networking | ||
---|---|---|
asynchat | 详细 | |
asyncore | 详细 | |
popen2 | 详细 | |
signal | 详细 | |
socket | 详细 | |
ssl | 详细 | |
subprocess | 详细 |
数字与数学 | Numeric & Mathematical | ||
---|---|---|
cmath | 详细 | |
decimal | 详细 | |
fractions | 详细 | |
functools | 详细 | |
itertools | 详细 | |
math | 详细 | |
numbers | 详细 | |
operator | 详细 | |
random | 详细 |
操作系统 | Operating System | ||
---|---|---|
argparse | 详细 | |
ctypes | 详细 | |
curses | 详细 | |
curses.ascii | 详细 | |
curses.panel | 详细 | |
errno | 详细 | |
getopt | 详细 | |
getpass | 详细 | |
io | 详细 | |
optparse | 详细 | |
os | 详细 | |
platform | 详细 | |
time | 详细 |
可选操作系统 | Optional Operating System | ||
---|---|---|
dummy_thread | 详细 | |
dummy_threading | 详细 | |
mmap | 详细 | |
multiprocessing | 详细 | |
readline | 详细 | |
rlcompleter | 详细 | |
thread | 详细 | |
threading | 详细 |
限制执行 | Restricted Execution | ||
---|---|---|
Bastion | 详细 | |
Restricted Execution | 详细 | |
rexec | 详细 |
运行 | Runtime | ||
---|---|---|
abc | 详细 | |
atexit | 详细 | |
contextlib | 详细 | |
fpectl | 详细 | |
future_builtins | 详细 | |
gc | 详细 | |
inspect | 详细 | |
site | 详细 | |
sys | 详细 | |
sysconfig | 详细 | |
traceback | 详细 | |
user | 详细 | |
warnings | 详细 | |
__builtin__ | 详细 | |
__future__ | 详细 | |
__main__ | 详细 |
SGI IRIX | ||
---|---|---|
al | 详细 | |
cd | 详细 | |
fl | 详细 | |
fm | 详细 | |
gl | 详细 | |
imgfile | 详细 | |
jpeg | 详细 |
软件包装与分销 | Software Packaging & Distribution | ||
---|---|---|
distutils | 详细 | |
ensurepip | 详细 |
字符串 | String | ||
---|---|---|
codecs | 详细 | |
difflib | 详细 | |
fpformat | 详细 | |
re | 详细 | |
string | 详细 | |
StringIO | 详细 | |
stringprep | 详细 | |
struct | 详细 | |
textwrap | 详细 | |
unicodedata | 详细 |
Tk | ||
---|---|---|
IDLE | 详细 | |
Other Graphical User Interface Packages | 详细 | |
ScrolledText | 详细 | |
Tix | 详细 | |
Tkinter | 详细 | |
ttk | 详细 | |
turtle | 详细 |
Unix | ||
---|---|---|
commands | 详细 | |
crypt | 详细 | |
dl | 详细 | |
fcntl | 详细 | |
grp | 详细 | |
nis | 详细 | |
pipes | 详细 | |
posix | 详细 | |
posixfile | 详细 | |
pty | 详细 | |
pwd | 详细 | |
resource | 详细 | |
spwd | 详细 | |
syslog | 详细 | |
termios | 详细 | |
tty | 详细 |
Python 简介 |
---|
Python pass 语句 |
---|
Python 循环嵌套 |
---|
Python 运算符 |
---|
Python log10() 函数 |
---|
Python log() 函数 |
---|
Python floor() 函数 |
---|
Python fabs() 函数 |
---|
Python exp() 函数 |
---|
Python cmp() 函数 |
---|
Python ceil() 函数 |
---|
Python abs() 函数 |
---|
Python Number(数字) |
---|
Python pow() 函数 |
---|
Python modf() 函数 |
---|
Python min() 函数 |
---|
Python max() 函数 |
---|
Python asin() 函数 |
---|
Python acos() 函数 |
---|
Python uniform() 函数 |
---|
Python shuffle() 函数 |
---|
Python seed() 函数 |
---|
Python random() 函数 |
---|
Python randrange() 函数 |
---|
Python choice() 函数 |
---|
Python sqrt() 函数 |
---|
Python round() 函数 |
---|
Python radians() 函数 |
---|
Python degrees() 函数 |
---|
Python tan() 函数 |
---|
Python sin() 函数 |
---|
Python hypot() 函数 |
---|
Python cos() 函数 |
---|
Python atan2() 函数 |
---|
Python atan() 函数 |
---|
Python 元组 |
---|
Python 列表(List) |
---|
Python 字符串 |
---|
Python 字典(Dictionary) |
---|
Python 日期和时间 |
---|
Python 函数 |
---|
Python 模块 |
---|
Python capitalize()方法 |
---|
Python center()方法 |
---|
Python count() 方法 |
---|
Python expandtabs()方法 |
---|
Python endswith()方法 |
---|
Python encode()方法 |
---|
Python decode()方法 |
---|
Python find()方法 |
---|
Python index()方法 |
---|
Python 异常处理 |
---|
Python isspace()方法 |
---|
Python isnumeric()方法 |
---|
Python islower()方法 |
---|
Python isdigit()方法 |
---|
Python isalpha()方法 |
---|
Python isalnum()方法 |
---|
Python isupper()方法 |
---|
Python istitle()方法 |
---|
Python min()方法 |
---|
Python max()方法 |
---|
Python maketrans()方法 |
---|
Python lstrip()方法 |
---|
Python lower()方法 |
---|
Python ljust()方法 |
---|
Python len()方法 |
---|
Python join()方法 |
---|
Python 正则表达式 |
---|
Python 面向对象 |
---|
Python rstrip()方法 |
---|
Python rjust()方法 |
---|
Python rindex()方法 |
---|
Python rfind()方法 |
---|
Python replace()方法 |
---|
Python 操作 MySQL 数据库 |
---|
Python startswith()方法 |
---|
Python splitlines()方法 |
---|
Python split()方法 |
---|
Python isdecimal()方法 |
---|
Python zfill()方法 |
---|
Python upper()方法 |
---|
Python translate()方法 |
---|
Python title()方法 |
---|
Python swapcase()方法 |
---|
Python strip()方法 |
---|
Python 多线程 |
---|
Python List list()方法 |
---|
Python List min()方法 |
---|
Python List max()方法 |
---|
Python List len()方法 |
---|
Python List cmp()方法 |
---|
Python XML 解析 |
---|
Python Tuple(元组) cmp()方法 |
---|
Python List sort()方法 |
---|
Python List reverse()方法 |
---|
Python List remove()方法 |
---|
Python List pop()方法 |
---|
Python List insert()方法 |
---|
Python List index()方法 |
---|
Python List extend()方法 |
---|
Python List count()方法 |
---|
Python List append()方法 |
---|
Python 字典(Dictionary) copy()方法 |
---|
Python 字典(Dictionary) clear()方法 |
---|
Python 字典(Dictionary) type()方法 |
---|
Python 字典(Dictionary) str()方法 |
---|
Python 字典(Dictionary) len()方法 |
---|
Python 字典(Dictionary) cmp()方法 |
---|
Python Tuple(元组) tuple()方法 |
---|
Python Tuple(元组) min()方法 |
---|
Python Tuple(元组) max()方法 |
---|
Python Tuple(元组) len()方法 |
---|
Python time asctime()方法 |
---|
Python time altzone()方法 |
---|
Python 字典(Dictionary) values()方法 |
---|
Python 字典(Dictionary) update()方法 |
---|
Python 字典(Dictionary) setdefault()方法 |
---|
Python 字典(Dictionary) keys()方法 |
---|
Python 字典(Dictionary) items()方法 |
---|
Python 字典(Dictionary) has_key()方法 |
---|
Python 字典(Dictionary) get()方法 |
---|
Python 字典 fromkeys() 方法 |
---|
Python time time()方法 |
---|
Python time strptime()方法 |
---|
Python time strftime()方法 |
---|
Python time sleep()方法 |
---|
Python time mktime()方法 |
---|
Python time localtime()方法 |
---|
Python time gmtime()方法 |
---|
Python time ctime()方法 |
---|
Python time clock()方法 |
---|
Python time tzset()方法 |
---|
Python2.x与3.x版本区别 |
---|
Python JSON |
---|
Python partition() 方法 |
---|
Python 练习实例9 |
---|
Python 练习实例8 |
---|
Python 练习实例7 |
---|
Python 练习实例6 |
---|
Python 练习实例5 |
---|
Python 100例 |
---|
Python 练习实例4 |
---|
Python 练习实例3 |
---|
Python 练习实例2 |
---|
Python 练习实例1 |
---|
Python 练习实例19 |
---|
Python 练习实例18 |
---|
Python 练习实例17 |
---|
Python 练习实例16 |
---|
Python 练习实例15 |
---|
Python 练习实例14 |
---|
Python 练习实例13 |
---|
Python 练习实例12 |
---|
Python 练习实例11 |
---|
Python 练习实例10 |
---|
Python 练习实例29 |
---|
Python 练习实例28 |
---|
Python 练习实例27 |
---|
Python 练习实例26 |
---|
Python 练习实例25 |
---|
Python 练习实例24 |
---|
Python 练习实例23 |
---|
Python 练习实例22 |
---|
Python 练习实例21 |
---|
Python 练习实例20 |
---|
Python 练习实例39 |
---|
Python 练习实例38 |
---|
Python 练习实例37 |
---|
Python 练习实例36 |
---|
Python 练习实例35 |
---|
Python 练习实例34 |
---|
Python 练习实例33 |
---|
Python 练习实例32 |
---|
Python 练习实例31 |
---|
Python 练习实例30 |
---|
Python 练习实例49 |
---|
Python 练习实例48 |
---|
Python 练习实例47 |
---|
Python 练习实例46 |
---|
Python 练习实例45 |
---|
Python 练习实例44 – Python 两个矩阵相加 |
---|
Python 练习实例43 |
---|
Python 练习实例42 |
---|
Python 练习实例41 |
---|
Python 练习实例40 |
---|
Python 练习实例59 |
---|
Python 练习实例58 |
---|
Python 练习实例57 |
---|
Python 练习实例56 |
---|
Python 练习实例55 |
---|
Python 练习实例54 |
---|
Python 练习实例53 |
---|
Python 练习实例52 |
---|
Python 练习实例51 |
---|
Python 练习实例50 |
---|
Python 练习实例69 |
---|
Python 练习实例68 |
---|
Python 练习实例67 |
---|
Python 练习实例66 |
---|
Python 练习实例65 |
---|
Python 练习实例64 |
---|
Python 练习实例63 |
---|
Python 练习实例62 |
---|
Python 练习实例61 |
---|
Python 练习实例60 |
---|
Python 练习实例80 |
---|
Python 练习实例79 |
---|
Python 练习实例78 |
---|
Python 练习实例77 |
---|
Python 练习实例76 |
---|
Python 练习实例75 |
---|
Python 练习实例74 |
---|
Python 练习实例73 |
---|
Python 练习实例71 |
---|
Python 练习实例70 |
---|
Python 练习实例89 |
---|
Python 练习实例72 |
---|
Python 练习实例88 |
---|
Python 练习实例87 |
---|
Python 练习实例86 |
---|
Python 练习实例85 |
---|
Python 练习实例84 |
---|
Python 练习实例83 |
---|
Python 练习实例82 |
---|
Python 练习实例81 |
---|
Python 练习实例99 |
---|
Python 练习实例98 |
---|
Python 练习实例97 |
---|
Python 练习实例96 |
---|
Python 练习实例95 |
---|
Python 练习实例94 |
---|
Python 练习实例93 |
---|
Python 练习实例92 |
---|
Python 练习实例91 |
---|
Python 练习实例90 |
---|
Python 练习实例100 |
---|
Python File(文件) 方法 |
---|
Python File tell() 方法 |
---|
Python File seek() 方法 |
---|
Python File readlines() 方法 |
---|
Python File readline() 方法 |
---|
Python File read() 方法 |
---|
Python File next() 方法 |
---|
Python File isatty() 方法 |
---|
Python File fileno() 方法 |
---|
Python File flush() 方法 |
---|
Python File close() 方法 |
---|
Python os.close() 方法 |
---|
Python os.chroot() 方法 |
---|
Python os.chmod() 方法 |
---|
Python os.chflags() 方法 |
---|
Python os.chdir() 方法 |
---|
Python os.access() 方法 |
---|
Python OS 文件/目录方法 |
---|
Python File writelines() 方法 |
---|
Python File write() 方法 |
---|
Python File truncate() 方法 |
---|
Python os.fstat() 方法 |
---|
Python os.fpathconf() 方法 |
---|
Python os.fdopen() 方法 |
---|
Python os.fdatasync() 方法 |
---|
Python os.fchown() 方法 |
---|
Python os.fchmod() 方法 |
---|
Python os.fchdir() 方法 |
---|
Python os.dup2() 方法 |
---|
Python os.dup() 方法 |
---|
Python os.closerange() 方法 |
---|
Python os.chown() 方法 |
---|
Python os.lchown() 方法 |
---|
Python os.lchmod() 方法 |
---|
Python os.lchflags() 方法 |
---|
Python os.isatty() 方法 |
---|
Python os.getcwdu() 方法 |
---|
Python os.getcwd() 方法 |
---|
Python os.ftruncate() 方法 |
---|
Python os.fsync() 方法 |
---|
Python os.fstatvfs() 方法 |
---|
Python os.mkfifo() 方法 |
---|
Python os.mkdir() 方法 |
---|
Python os.minor() 方法 |
---|
Python os.makedirs() 方法 |
---|
Python os.makedev() 方法 |
---|
Python os.major() 方法 |
---|
Python os.lstat() 方法 |
---|
Python os.lseek() 方法 |
---|
Python os.listdir() 方法 |
---|
Python os.link() 方法 |
---|
Python os.removedirs() 方法 |
---|
Python os.remove() 方法 |
---|
Python os.readlink() 方法 |
---|
Python os.read() 方法 |
---|
Python os.popen() 方法 |
---|
Python os.pipe() 方法 |
---|
Python os.pathconf() 方法 |
---|
Python os.openpty() 方法 |
---|
Python os.open() 方法 |
---|
Python os.mknod() 方法 |
---|
Python os.tempnam() 方法 |
---|
Python os.tcsetpgrp() 方法 |
---|
Python os.tcgetpgrp() 方法 |
---|
Python os.symlink() 方法 |
---|
Python os.statvfs() 方法 |
---|
Python os.stat_float_times() 方法 |
---|
Python os.stat() 方法 |
---|
Python os.renames() 方法 |
---|
Python os.rmdir() 方法 |
---|
Python os.rename() 方法 |
---|
Python os.write() 方法 |
---|
Python os.walk() 方法 |
---|
Python os.utime() 方法 |
---|
Python os.unlink() 方法 |
---|
Python os.ttyname() 方法 |
---|
Python os.tmpnam() 方法 |
---|
Python os.tmpfile() 方法 |
---|
Python 命令行参数 |
---|
Python 网络编程 |
---|
Python 内置函数 |
---|
Python range() 函数 |
---|
Python – 获取 100 以内的质数 |
---|
Python format 格式化函数 |
---|
Python ord() 函数 |
---|
Python int() 函数 |
---|
Python enumerate() 函数 |
---|
Python any() 函数 |
---|
Python all() 函数 |
---|
Python staticmethod() 函数 |
---|
Python open() 函数 |
---|
Python raw_input() 函数 |
---|
Python input() 函数 |
---|
Python divmod() 函数 |
---|
Python type() 函数 |
---|
Python isinstance() 函数 |
---|
Python compile() 函数 |
---|
Python execfile() 函数 |
---|
Python exec 内置语句 |
---|
Python eval() 函数 |
---|
Python repr() 函数 |
---|
Python str() 函数 |
---|
Python unichr() 函数 |
---|
Python chr() 函数 |
---|
Python bool() 函数 |
---|
Python property() 函数 |
---|
Python iter() 函数 |
---|
Python file() 函数 |
---|
Python bin() 函数 |
---|
Python super() 函数 |
---|
Python issubclass() 函数 |
---|
Python basestring() 函数 |
---|
Python sum() 函数 |
---|
Python frozenset() 函数 |
---|
Python map() 函数 |
---|
Python reduce() 函数 |
---|
Python vars() 函数 |
---|
Python globals() 函数 |
---|
Python locals() 函数 |
---|
Python callable() 函数 |
---|
Python float() 函数 |
---|
Python bytearray() 函数 |
---|
Python filter() 函数 |
---|
Python memoryview() 函数 |
---|
Python zip() 函数 |
---|
Python xrange() 函数 |
---|
Python hasattr() 函数 |
---|
Python delattr() 函数 |
---|
Python setattr() 函数 |
---|
Python getattr() 函数 |
---|
Python classmethod 修饰符 |
---|
Python reload() 函数 |
---|
Python long() 函数 |
---|
Python dir() 函数 |
---|
Python slice() 函数 |
---|
Python hex() 函数 |
---|
Python dict() 函数 |
---|
Python next() 函数 |
---|
Python help() 函数 |
---|
Python set() 函数 |
---|
Python hash() 函数 |
---|
Python complex() 函数 |
---|
Python __import__() 函数 |
---|
Python sorted() 函数 |
---|
Python oct() 函数 |
---|
Python id() 函数 |
---|
Python 字典 popitem() 方法 |
---|
Python 字典 pop() 方法 |
---|
Python rpartition() 方法 |
---|
Python Tkinter 复选框(Checkbutton) |
---|
Python Tkinter 画布(Canvas) |
---|
Python Tkinter 按钮组件 |
---|
Python Tkinter 文本框(Entry) |
---|
Python os.path() 模块 |
---|
Python Tkinter 标签控件(Label) |
---|
Python Tkinter 框架控件(Frame) |
---|
Python资料
主页 | https://www.python.org/ |
源码 | https://github.com/python/cpython |
版本 | 2.7 |
发布版本 | 2.7.13 |