The Python Standard Library by Example
Introduction
1.
文本
1.1.
string-文本常量和模板
1.2.
textwrap-格式化文本段落
1.3.
Re—正则表达式
1.4.
difflib-比较序列
2.
数据结构
2.1.
collections-容器数据类型
2.2.
array-固定类型数据序列
2.3.
heapq-堆排序算法
2.4.
bisect-维护有序列表
2.5.
Queue-线程安全的FIFO实现
2.6.
struct-二进制数据结构
2.7.
weakref-对象的非永久引用
2.8.
copy-复制对象
2.9.
pprint-美观打印数据结构
3.
算法
3.1.
functools-管理函数的工具
3.2.
itertools-迭代器函数
3.3.
operator-内置操作符的函数接口
3.4.
contextlib-上下文管理器工具
4.
日期和时间
4.1.
time-时钟时间
4.2.
datetime-日期和时间值管理
4.3.
calendar-处理日期
5.
数学计算
5.1.
decimal-定点数和浮点数的数学运算
5.2.
fractions-有理数
5.3.
random-伪随机数生成器
5.4.
math-数学函数
6.
文件系统
6.1.
os.path-平台独立的文件名管理
6.2.
glob-文件名模式匹配
6.3.
linecache-高效读取文本文件
6.4.
tempfile-临时文件系统对象
6.5.
shutil-高级文件操作
6.6.
mmap-内存映射文件
6.7.
codecs-字符串编码和解码
6.8.
StringIO-提供类文件API的文本缓冲区
6.9.
fnmatch-UNIX式glob模式匹配
6.10.
dircache-缓存目录列表
6.11.
filecmp-比较文件
7.
数据持久存储与交换
7.1.
pickle-对象序列化
7.2.
shelve-对象持久存储
7.3.
anydbm-DBM数据库
7.4.
whichdb-识别DBM数据库格式
7.5.
sqlite3-嵌入式关系数据库
7.6.
xml.etree.ElementTree-XML操作API
7.7.
csv-逗号分隔值文件
8.
数据压缩与归档
8.1.
zlib-GNU zlib压缩
8.2.
gzip-读写GNU zip文件
8.3.
bz2-bzip2 压缩
8.4.
tarfile-Tar归档访问
8.5.
zipfile-ZIP归档访问
9.
加密
9.1.
hashlib-密码散列
9.2.
hmac-密码消息签名与验证
10.
进程与线程
10.1.
subprocess-创建附加进程
10.2.
signal-异步系统事件
10.3.
threading-管理并发操作
10.4.
multiprocessing-像线程一样管理进程
11.
网络通信
11.1.
socket-网络通信
11.2.
select-高效等待I/O
11.3.
SocketServer-创建网络服务器
11.4.
asyncore-异步I/O
11.5.
asynchat-异步协议处理器
12.
Internet
12.1.
urlparse-分解URL
12.2.
BaseHTTPServer-实现Web服务器的基类
12.3.
urllib-网络资源访问
12.4.
urllib2-网络资源访问
12.5.
Base64-用ASCII编码二进制数据
12.6.
robotparser-网络蜘蛛访问控制
12.7.
Cookie-HTTP Cookie
12.8.
uuid-全局唯一标识符
12.9.
json-JavaScript对象记法
12.10.
xmlrpclib-XML-RPC的客户端库
12.11.
SimpleXMLRPCServer-一个XML-RPC服务器
13.
EMAIL
13.1.
Smtplib—Simple Mail Transfer Protocol Client
13.2.
Smtpd—Sample Mail Servers
13.3.
Imaplib—IMAP4 Client Library
13.4.
Mailbox—Manipulate Email Archives
14.
应用构建模块
14.1.
Getopt—Command-Line Option Parsing
14.2.
Optparse—Command-Line Option Parser
14.3.
Argparse—Command-Line Option and Argument Parsing
14.4.
Readline—The GNU Readline Library
14.5.
Getpass—Secure Password Prompt
14.6.
Cmd—Line-Oriented Command Processors
14.7.
Shlex—Parse Shell-Style Syntaxes
14.8.
ConfigParser—Work with Configuration Files
14.9.
Logging—Report Status, Error, and Informational Messages
14.10.
Fileinput—Command-Line Filter Framework
14.11.
Atexit—Program Shutdown Callbacks
14.12.
Sched—Timed Event Scheduler
15.
国际化和本地化
15.1.
Gettext—Message Catalogs
15.2.
Gettext—Message Catalogs
16.
开发工具
16.1.
pydoc-模块的联机帮助
16.2.
Doctest—Testing through Documentation
16.3.
unittest-自动测试框架
16.4.
Traceback—Exceptions and Stack Traces
16.5.
Cgitb—Detailed Traceback Reports
16.6.
Pdb—Interactive Debugger
16.7.
Trace—Follow Program Flow
16.8.
Profile and pstats—Performance Analysis
16.9.
Timeit—Time the Execution of Small Bits of Python Code
16.10.
Compileall—Byte-Compile Source Files
16.11.
Pyclbr—Class Browser
17.
运行时特性
17.1.
site-全站点配置
17.2.
sys-系统特定的配置
17.3.
os-可移植访问操作系统特定特性
17.4.
platform-系统版本信息
17.5.
resource-系统资源管理
17.6.
gc-垃圾回收器
17.7.
sysconfig-解释器编译时配置
18.
语言工具
18.1.
Warnings—Nonfatal Alerts
18.2.
Abc—Abstract Base Classes
18.3.
Dis—Python Bytecode Disassembler
18.4.
Inspect—Inspect Live Objects
18.5.
Exceptions—Built-in Exception Classes
19.
模块与包
19.1.
Imp—Python’s Import Mechanism
19.2.
Zipimport—Load Python Code from ZIP Archives
19.3.
Pkgutil—Package Utilities
Powered by
GitBook
A
A
Serif
Sans
White
Sepia
Night
Share on Twitter
Share on Google
Share on Facebook
Share on Weibo
Share on Instapaper
The Python Standard Library by Example
codecs-字符串编码和解码