Python 文档目录
***************

* Python的新变化

  * Python 2.7 有什么新变化

    * Python 2.x的未来

    * Changes to the Handling of Deprecation Warnings

    * Python 3.1 Features

    * PEP 372: Adding an Ordered Dictionary to collections

    * PEP 378: 千位分隔符的格式说明符

    * PEP 389: The argparse Module for Parsing Command Lines

    * PEP 391: Dictionary-Based Configuration For Logging

    * PEP 3106: Dictionary Views

    * PEP 3137: The memoryview Object

    * 其他语言特性修改

      * Interpreter Changes

      * 性能优化

    * 新增和改进的模块

      * 新模块：importlib

      * 新模块：sysconfig

      * ttk: Themed Widgets for Tk

      * 更新的模块：unittest

      * 更新的模块：ElementTree 1.3

    * 构建和 C API 的改变

      * 胶囊

      * 特定于端口的更改：Windows

      * 特定于端口的更改：Mac OS X

      * Port-Specific Changes: FreeBSD

    * Other Changes and Fixes

    * 移植到 Python 2.7

    * New Features Added to Python 2.7 Maintenance Releases

      * Two new environment variables for debug mode

      * PEP 434: IDLE Enhancement Exception for All Branches

      * PEP 466: Network Security Enhancements for Python 2.7

      * PEP 477: Backport ensurepip (PEP 453) to Python 2.7

        * Bootstrapping pip By Default

        * Documentation Changes

      * PEP 476: Enabling certificate verification by default for
        stdlib http clients

      * PEP 493：适用于Python 2.7 的HTTPS验证迁移工具

      * New "make regen-all" build target

      * Removal of "make touch" build target

    * 致谢

  * Python 2.6 有什么新变化

    * Python 3.0

    * 开发过程的变化

      * New Issue Tracker: Roundup

      * 新的文档格式：使用 Sphinx 的 reStructuredText

    * PEP 343: “with” 语句

      * Writing Context Managers

      * contextlib 模块

    * PEP 366: 从主模块显式相对导入

    * PEP 370: 分用户的 site-packages 目录

    * PEP 371: 多任务处理包

    * PEP 3101: 高级字符串格式

    * PEP 3105: "print" 改为函数

    * PEP 3110: 异常处理的变更

    * PEP 3112: 字节字面值

    * PEP 3116: 新 I/O 库

    * PEP 3118: 修改缓冲区协议

    * PEP 3119: 抽象基类

    * PEP 3127: 整型文字支持和语法

    * PEP 3129: 类装饰器

    * PEP 3141: A Type Hierarchy for Numbers

      * "fractions" 模块

    * 其他语言特性修改

      * 性能优化

      * Interpreter Changes

    * 新增和改进的模块

      * "ast" 模块

      * "future_builtins" 模块

      * The "json" module: JavaScript Object Notation

      * "plistlib" 模块：属性列表解析器

      * ctypes Enhancements

      * Improved SSL Support

    * Deprecations and Removals

    * 构建和 C API 的改变

      * 特定于端口的更改：Windows

      * 特定于端口的更改：Mac OS X

      * 特定于端口的更改：IRIX

    * 移植到Python 2.6

    * 致谢

  * Python 2.5 有什么新变化

    * PEP 308: 条件表达式

    * PEP 309: 部分功能应用

    * PEP 314: Python软件包的元数据 v1.1

    * PEP 328: 绝对导入和相对导入

    * PEP 338: 将模块作为脚本执行

    * PEP 341: 统一 try/except/finally

    * PEP 342: 生成器的新特性

    * PEP 343: “with” 语句

      * Writing Context Managers

      * contextlib 模块

    * PEP 352: 异常作为新型的类

    * PEP 353: 使用ssize_t作为索引类型

    * PEP 357: ‘__index__’ 方法

    * 其他语言特性修改

      * 交互解释器变更

      * 性能优化

    * 新增，改进和删除的模块

      * ctypes 包

      * ElementTree 包

      * hashlib 包

      * sqlite3 包

      * wsgiref 包

    * 构建和 C API 的改变

      * Port-Specific Changes

    * 移植到Python 2.5

    * 致谢

  * Python 2.4 有什么新变化

    * PEP 218: 内置集合对象

    * PEP 237: 统一长整数和整数

    * PEP 289: 生成器表达式

    * PEP 292: Simpler String Substitutions

    * PEP 318: Decorators for Functions and Methods

    * PEP 322: 反向迭代

    * PEP 324: 新的子进程模块

    * PEP 327: 十进数据类型

      * 为什么需要十进制？

      * "Decimal" 类型

      * "Context" 类型

    * PEP 328: 多行导入

    * PEP 331: Locale-Independent Float/String Conversions

    * 其他语言特性修改

      * 性能优化

    * 新增，改进和弃用的模块

      * cookielib

      * doctest

    * 构建和 C API 的改变

      * Port-Specific Changes

    * 移植到 Python 2.4

    * 致谢

  * Python 2.3 有什么新变化

    * PEP 218: A Standard Set Datatype

    * PEP 255: Simple Generators

    * PEP 263: Source Code Encodings

    * PEP 273: 从ZIP压缩包导入模块

    * PEP 277: Unicode file name support for Windows NT

    * PEP 278: 通用换行支持

    * PEP 279: enumerate()

    * PEP 282: logging 包

    * PEP 285: 布尔类型

    * PEP 293: Codec Error Handling Callbacks

    * PEP 301: Distutils的软件包索引和元数据

    * PEP 302: New Import Hooks

    * PEP 305: 逗号分隔文件

    * PEP 307: Pickle Enhancements

    * 扩展切片

    * 其他语言特性修改

      * String Changes

      * 性能优化

    * 新增，改进和弃用的模块

      * Date/Time 类型

      * optparse 模块

    * Pymalloc: A Specialized Object Allocator

    * 构建和 C API 的改变

      * Port-Specific Changes

    * Other Changes and Fixes

    * 移植到 Python 2.3

    * 致谢

  * Python 2.2 有什么新变化

    * 概述

    * PEPs 252 and 253: Type and Class Changes

      * Old and New Classes

      * Descriptors

      * Multiple Inheritance: The Diamond Rule

      * Attribute Access

      * Related Links

    * PEP 234: Iterators

    * PEP 255: Simple Generators

    * PEP 237: 统一长整数和整数

    * PEP 238: Changing the Division Operator

    * Unicode Changes

    * PEP 227: Nested Scopes

    * 新增和改进的模块

    * Interpreter Changes and Fixes

    * Other Changes and Fixes

    * 致谢

  * Python 2.1 有什么新变化

    * 概述

    * PEP 227: Nested Scopes

    * PEP 236: __future__ Directives

    * PEP 207: Rich Comparisons

    * PEP 230: Warning Framework

    * PEP 229: New Build System

    * PEP 205: Weak References

    * PEP 232: Function Attributes

    * PEP 235: Importing Modules on Case-Insensitive Platforms

    * PEP 217: Interactive Display Hook

    * PEP 208: New Coercion Model

    * PEP 241: Metadata in Python Packages

    * 新增和改进的模块

    * Other Changes and Fixes

    * 致谢

  * Python 2.0 有什么新变化

    * 概述

    * What About Python 1.6?

    * 新开发流程

    * Unicode

    * 列表推导式

    * Augmented Assignment

    * 字符串的方法

    * Garbage Collection of Cycles

    * 其他核心变化

      * Minor Language Changes

      * Changes to Built-in Functions

    * 移植 Python 2.0

    * 扩展/嵌入更改

    * Distutils：使模块易于安装

    * XML 模块

      * SAX2 Support

      * DOM Support

      * Relationship to PyXML

    * 模块更改

    * 新增模块

    * IDLE 改进

    * 删除和弃用的模块

    * 致谢

* Python 教程

  * 1. 课前甜点

  * 2. 使用 Python 解释器

    * 2.1. 调用解释器

      * 2.1.1. 传入参数

      * 2.1.2. 交互模式

    * 2.2. 解释器的运行环境

      * 2.2.1. 源文件的字符编码

  * 3. Python 的非正式介绍

    * 3.1. Python 作为计算器使用

      * 3.1.1. 数字

      * 3.1.2. 字符串

      * 3.1.3. Unicode Strings

      * 3.1.4. 列表

    * 3.2. 走向编程的第一步

  * 4. 其他流程控制工具

    * 4.1. "if" Statements

    * 4.2. "for" Statements

    * 4.3. "range()" 函数

    * 4.4. "break" and "continue" Statements, and "else" Clauses on
      Loops

    * 4.5. "pass" Statements

    * 4.6. 定义函数

    * 4.7. 函数定义的更多形式

      * 4.7.1. 参数默认值

      * 4.7.2. 关键字参数

      * 4.7.3. 任意的参数列表

      * 4.7.4. 解包参数列表

      * 4.7.5. Lambda 表达式

      * 4.7.6. 文档字符串

    * 4.8. 小插曲：编码风格

  * 5. 数据结构

    * 5.1. 列表的更多特性

      * 5.1.1. 列表作为栈使用

      * 5.1.2. 列表作为队列使用

      * 5.1.3. Functional Programming Tools

      * 5.1.4. 列表推导式

        * 5.1.4.1. 嵌套的列表推导式

    * 5.2. The "del" statement

    * 5.3. 元组和序列

    * 5.4. 集合

    * 5.5. 字典

    * 5.6. 循环的技巧

    * 5.7. 深入条件控制

    * 5.8. 比较序列和其他类型

  * 6. 模块

    * 6.1. 更多有关模块的信息

      * 6.1.1. 以脚本的方式执行模块

      * 6.1.2. 模块搜索路径

      * 6.1.3. “编译过的”Python文件

    * 6.2. 标准模块

    * 6.3. "dir()" 函数

    * 6.4. 包

      * 6.4.1. 从包中导入 *

      * 6.4.2. 子包参考

      * 6.4.3. 多个目录中的包

  * 7. 输入输出

    * 7.1. 更漂亮的输出格式

      * 7.1.1. 旧的字符串格式化方法

    * 7.2. 读写文件

      * 7.2.1. 文件对象的方法

      * 7.2.2. 使用 "json" 保存结构化数据

  * 8. 错误和异常

    * 8.1. 语法错误

    * 8.2. 异常

    * 8.3. 处理异常

    * 8.4. 抛出异常

    * 8.5. 用户自定义异常

    * 8.6. 定义清理操作

    * 8.7. 预定义的清理操作

  * 9. 类

    * 9.1. 名称和对象

    * 9.2. Python 作用域和命名空间

    * 9.3. 初探类

      * 9.3.1. 类定义语法

      * 9.3.2. 类对象

      * 9.3.3. 实例对象

      * 9.3.4. 方法对象

      * 9.3.5. 类和实例变量

    * 9.4. 补充说明

    * 9.5. 继承

      * 9.5.1. 多重继承

    * 9.6. Private Variables and Class-local References

    * 9.7. 杂项说明

    * 9.8. Exceptions Are Classes Too

    * 9.9. 迭代器

    * 9.10. 生成器

    * 9.11. 生成器表达式

  * 10. 标准库简介

    * 10.1. 操作系统接口

    * 10.2. 文件通配符

    * 10.3. 命令行参数

    * 10.4. 错误输出重定向和程序终止

    * 10.5. 字符串模式匹配

    * 10.6. 数学

    * 10.7. 互联网访问

    * 10.8. 日期和时间

    * 10.9. 数据压缩

    * 10.10. 性能测量

    * 10.11. 质量控制

    * 10.12. 自带电池

  * 11. 标准库简介 —— 第二部分

    * 11.1. 格式化输出

    * 11.2. 模板

    * 11.3. 使用二进制数据记录格式

    * 11.4. 多线程

    * 11.5. 日志记录

    * 11.6. 弱引用

    * 11.7. 用于操作列表的工具

    * 11.8. 十进制浮点运算

  * 12. 接下来？

  * 13. 交互式编辑和编辑历史

    * 13.1. Line Editing

    * 13.2. History Substitution

    * 13.3. Key Bindings

    * 13.4. 默认交互式解释器的替代品

  * 14. 浮点算术：争议和限制

    * 14.1. 表示性错误

  * 15. 附录

    * 15.1. 交互模式

      * 15.1.1. 错误处理

      * 15.1.2. 可执行的Python脚本

      * 15.1.3. 交互式启动文件

      * 15.1.4. 定制模块

* Python安装和使用

  * 1. 命令行与环境

    * 1.1. 命令行

      * 1.1.1. 接口选项

      * 1.1.2. 通用选项

      * 1.1.3. 其他选项

      * 1.1.4. 不应当使用的选项

    * 1.2. 环境变量

      * 1.2.1. 调试模式变量

  * 2. 在类Unix环境下使用Python

    * 2.1. 获得并安装Python的最新版本

      * 2.1.1. 在Linux中

      * 2.1.2. 在FreeBSD和OpenBSD上

      * 2.1.3. 在OpenSolaris系统上

    * 2.2. 构建Python

    * 2.3. 与Python相关的路径和文件

    * 2.4. 杂项

    * 2.5. Editors and IDEs

  * 3. 在Windows上使用 Python

    * 3.1. Installing Python

    * 3.2. 替代捆绑包

    * 3.3. 配置Python

      * 3.3.1. 附录：设置环境变量

      * 3.3.2. 查找Python可执行文件

      * 3.3.3. 查找模块

      * 3.3.4. Executing scripts

    * 3.4. 附加模块

      * 3.4.1. PyWin32

      * 3.4.2. Py2exe

      * 3.4.3. WConio

    * 3.5. 在Windows上编译Python

    * 3.6. Other resources

  * 4. 在苹果系统上使用 Python

    * 4.1. 获取和安装 MacPython

      * 4.1.1. 如何运行 Python 脚本

      * 4.1.2. 运行有图形界面的脚本

      * 4.1.3. 配置

    * 4.2. IDE

    * 4.3. 安装额外的 Python 包

    * 4.4. Mac 上的图形界面编程

    * 4.5. 在 Mac 上分发 Python 应用程序

    * 4.6. 其他资源

* Python语言参考

  * 1. 概述

    * 1.1. 其他实现

    * 1.2. 标注

  * 2. 词法分析

    * 2.1. 行结构

      * 2.1.1. 逻辑行

      * 2.1.2. 物理行

      * 2.1.3. 注释

      * 2.1.4. 编码声明

      * 2.1.5. 显式的行拼接

      * 2.1.6. 隐式的行拼接

      * 2.1.7. 空白行

      * 2.1.8. 缩进

      * 2.1.9. 形符之间的空白

    * 2.2. 其他形符

    * 2.3. 标识符和关键字

      * 2.3.1. 关键字

      * 2.3.2. 保留的标识符类

    * 2.4. 字面值

      * 2.4.1. String literals

      * 2.4.2. 字符串字面值拼接

      * 2.4.3. 数字字面值

      * 2.4.4. Integer and long integer literals

      * 2.4.5. 浮点数字面值

      * 2.4.6. 虚数字面值

    * 2.5. 运算符

    * 2.6. 分隔符

  * 3. 数据模型

    * 3.1. 对象、值与类型

    * 3.2. 标准类型层级结构

    * 3.3. New-style and classic classes

    * 3.4. 特殊方法名称

      * 3.4.1. 基本定制

      * 3.4.2. 自定义属性访问

        * 3.4.2.1. More attribute access for new-style classes

        * 3.4.2.2. 实现描述器

        * 3.4.2.3. 发起调用描述器

        * 3.4.2.4. __slots__

      * 3.4.3. 自定义类创建

      * 3.4.4. 自定义实例及子类检查

      * 3.4.5. 模拟可调用对象

      * 3.4.6. 模拟容器类型

      * 3.4.7. Additional methods for emulation of sequence types

      * 3.4.8. 模拟数字类型

      * 3.4.9. Coercion rules

      * 3.4.10. with 语句上下文管理器

      * 3.4.11. Special method lookup for old-style classes

      * 3.4.12. Special method lookup for new-style classes

  * 4. 执行模型

    * 4.1. 命名与绑定

      * 4.1.1. 与动态特性的交互

    * 4.2. 异常

  * 5. 表达式

    * 5.1. 算术转换

    * 5.2. 原子

      * 5.2.1. 标识符（名称）

      * 5.2.2. 字面值

      * 5.2.3. 带圆括号的形式

      * 5.2.4. 列表显示

      * 5.2.5. Displays for sets and dictionaries

      * 5.2.6. 生成器表达式

      * 5.2.7. 字典显示

      * 5.2.8. 集合显示

      * 5.2.9. String conversions

      * 5.2.10. yield 表达式

        * 5.2.10.1. 生成器-迭代器的方法

    * 5.3. 原型

      * 5.3.1. 属性引用

      * 5.3.2. 抽取

      * 5.3.3. 切片

      * 5.3.4. 调用

    * 5.4. 幂运算符

    * 5.5. 一元算术和位运算

    * 5.6. 二元算术运算符

    * 5.7. 移位运算

    * 5.8. 二元位运算

    * 5.9. 比较运算

      * 5.9.1. 值比较

      * 5.9.2. 成员检测运算

      * 5.9.3. 标识号比较

    * 5.10. 布尔运算

    * 5.11. Conditional Expressions

    * 5.12. lambda 表达式

    * 5.13. 表达式列表

    * 5.14. 求值顺序

    * 5.15. 运算符优先级

  * 6. 简单语句

    * 6.1. 表达式语句

    * 6.2. 赋值语句

      * 6.2.1. 增强赋值语句

    * 6.3. The "assert" statement

    * 6.4. The "pass" statement

    * 6.5. The "del" statement

    * 6.6. The "print" statement

    * 6.7. The "return" statement

    * 6.8. The "yield" statement

    * 6.9. The "raise" statement

    * 6.10. The "break" statement

    * 6.11. The "continue" statement

    * 6.12. The "import" statement

      * 6.12.1. future 语句

    * 6.13. The "global" statement

    * 6.14. The "exec" statement

  * 7. 复合语句

    * 7.1. The "if" statement

    * 7.2. The "while" statement

    * 7.3. The "for" statement

    * 7.4. The "try" statement

    * 7.5. The "with" statement

    * 7.6. 函数定义

    * 7.7. 类定义

  * 8. 最高层级组件

    * 8.1. 完整的 Python 程序

    * 8.2. 文件输入

    * 8.3. 交互式输入

    * 8.4. 表达式输入

  * 9. 完整的语法规范

* Python 标准库

  * 1. 概述

  * 2. 内置函数

  * 3. Non-essential Built-in Functions

  * 4. 内置常量

    * 4.1. 由 "site" 模块添加的常量

  * 5. 内置类型

    * 5.1. 逻辑值检测

    * 5.2. Boolean Operations — "and", "or", "not"

    * 5.3. 比较运算

    * 5.4. Numeric Types — "int", "float", "long", "complex"

      * 5.4.1. 整数类型的按位运算

      * 5.4.2. 整数类型的附加方法

      * 5.4.3. 浮点类型的附加方法

    * 5.5. 迭代器类型

      * 5.5.1. 生成器类型

    * 5.6. Sequence Types — "str", "unicode", "list", "tuple",
      "bytearray", "buffer", "xrange"

      * 5.6.1. 字符串的方法

      * 5.6.2. String Formatting Operations

      * 5.6.3. XRange Type

      * 5.6.4. 可变序列类型

    * 5.7. 集合类型 — "set", "frozenset"

    * 5.8. 映射类型 — "dict"

      * 5.8.1. 字典视图对象

    * 5.9. File Objects

    * 5.10. memoryview type

    * 5.11. 上下文管理器类型

    * 5.12. 其他内置类型

      * 5.12.1. 模块

      * 5.12.2. 类与类实例

      * 5.12.3. 函数

      * 5.12.4. 方法

      * 5.12.5. 代码对象

      * 5.12.6. 类型对象

      * 5.12.7. 空对象

      * 5.12.8. 省略符对象

      * 5.12.9. 未实现对象

      * 5.12.10. 布尔值

      * 5.12.11. 内部对象

    * 5.13. 特殊属性

  * 6. 内置异常

    * 6.1. 异常层次结构

  * 7. String Services

    * 7.1. "string" — 常见的字符串操作

      * 7.1.1. 字符串常量

      * 7.1.2. 自定义字符串格式化

      * 7.1.3. 格式字符串语法

        * 7.1.3.1. 格式规格迷你语言

        * 7.1.3.2. 格式示例

      * 7.1.4. 模板字符串

      * 7.1.5. String functions

      * 7.1.6. Deprecated string functions

    * 7.2. "re" — 正则表达式操作

      * 7.2.1. 正则表达式语法

      * 7.2.2. 模块内容

      * 7.2.3. 正则表达式对象 （正则对象）

      * 7.2.4. 匹配对象

      * 7.2.5. Examples

        * 7.2.5.1. Checking For a Pair

        * 7.2.5.2. 模拟 scanf()

        * 7.2.5.3. search() vs. match()

        * 7.2.5.4. 建立一个电话本

        * 7.2.5.5. 文字整理

        * 7.2.5.6. 找到所有副词

        * 7.2.5.7. 找到所有副词和位置

        * 7.2.5.8. 原始字符记法

    * 7.3. "struct" — Interpret strings as packed binary data

      * 7.3.1. 函数和异常

      * 7.3.2. 格式字符串

        * 7.3.2.1. 字节顺序，大小和对齐方式

        * 7.3.2.2. 格式字符

        * 7.3.2.3. 例子

      * 7.3.3. 类

    * 7.4. "difflib" — 计算差异的辅助工具

      * 7.4.1. SequenceMatcher 对象

      * 7.4.2. SequenceMatcher 的示例

      * 7.4.3. Differ 对象

      * 7.4.4. Differ 示例

      * 7.4.5. difflib 的命令行接口

    * 7.5. "StringIO" — Read and write strings as files

    * 7.6. "cStringIO" — Faster version of "StringIO"

    * 7.7. "textwrap" — 文本自动换行与填充

    * 7.8. "codecs" — 编解码器注册和相关基类

      * 7.8.1. 编解码器基类

        * 7.8.1.1. Codec Objects

        * 7.8.1.2. IncrementalEncoder 对象

        * 7.8.1.3. IncrementalDecoder 对象

        * 7.8.1.4. StreamWriter 对象

        * 7.8.1.5. StreamReader 对象

        * 7.8.1.6. StreamReaderWriter 对象

        * 7.8.1.7. StreamRecoder 对象

      * 7.8.2. 编码格式与 Unicode

      * 7.8.3. 标准编码

      * 7.8.4. Python 专属的编码格式

      * 7.8.5. "encodings.idna" — 应用程序中的国际化域名

      * 7.8.6. "encodings.utf_8_sig" — 带BOM签名的UTF-8编解码器

    * 7.9. "unicodedata" — Unicode 数据库

    * 7.10. "stringprep" — 因特网字符串预备

    * 7.11. "fpformat" — Floating point conversions

  * 8. 数据类型

    * 8.1. "datetime" — 基本的日期和时间类型

      * 8.1.1. 有效的类型

      * 8.1.2. "timedelta" 类对象

      * 8.1.3. "date" 对象

      * 8.1.4. "datetime" 对象

      * 8.1.5. "time" 对象

      * 8.1.6. "tzinfo" 对象

      * 8.1.7. "strftime()" 和 "strptime()" 的行为

    * 8.2. "calendar" — 日历相关函数

    * 8.3. "collections" — High-performance container datatypes

      * 8.3.1. "Counter" 对象

      * 8.3.2. "deque" 对象

        * 8.3.2.1. "deque" 用法

      * 8.3.3. "defaultdict" 对象

        * 8.3.3.1. "defaultdict" 例子

      * 8.3.4. "namedtuple()" 命名元组的工厂函数

      * 8.3.5. "OrderedDict" 对象

        * 8.3.5.1. "OrderedDict" 例子和用法

      * 8.3.6. Collections Abstract Base Classes

    * 8.4. "heapq" — 堆队列算法

      * 8.4.1. 基本示例

      * 8.4.2. 优先队列实现说明

      * 8.4.3. 理论

    * 8.5. "bisect" — 数组二分查找算法

      * 8.5.1. 搜索有序列表

      * 8.5.2. 其他示例

    * 8.6. "array" — 高效的数值数组

    * 8.7. "sets" — Unordered collections of unique elements

      * 8.7.1. Set Objects

      * 8.7.2. Example

      * 8.7.3. Protocol for automatic conversion to immutable

      * 8.7.4. Comparison to the built-in "set" types

    * 8.8. "sched" — 事件调度器

      * 8.8.1. 调度器对象

    * 8.9. "mutex" — Mutual exclusion support

      * 8.9.1. Mutex Objects

    * 8.10. "Queue" — A synchronized queue class

      * 8.10.1. Queue对象

    * 8.11. "weakref" — 弱引用

      * 8.11.1. 弱引用对象

      * 8.11.2. 示例

    * 8.12. "UserDict" — Class wrapper for dictionary objects

    * 8.13. "UserList" — Class wrapper for list objects

    * 8.14. "UserString" — Class wrapper for string objects

    * 8.15. "types" — Names for built-in types

    * 8.16. "new" — Creation of runtime internal objects

    * 8.17. "copy" — 浅层 (shallow) 和深层 (deep) 复制操作

    * 8.18. "pprint" — 数据美化输出

      * 8.18.1. PrettyPrinter 对象

      * 8.18.2. pprint Example

    * 8.19. "repr" — Alternate "repr()" implementation

      * 8.19.1. Repr Objects

      * 8.19.2. Subclassing Repr Objects

  * 9. 数字和数学模块

    * 9.1. "numbers" — 数字的抽象基类

      * 9.1.1. 数字的层次

      * 9.1.2. 类型接口注释。

        * 9.1.2.1. 加入更多数字的ABC

        * 9.1.2.2. 实现算数运算

    * 9.2. "math" — 数学函数

      * 9.2.1. 数论与表示函数

      * 9.2.2. 幂函数与对数函数

      * 9.2.3. 三角函数

      * 9.2.4. 角度转换

      * 9.2.5. 双曲函数

      * 9.2.6. 特殊函数

      * 9.2.7. 常量

    * 9.3. "cmath" ——关于复数的数学函数

      * 9.3.1. 到极坐标和从极坐标的转换

      * 9.3.2. 幂函数与对数函数

      * 9.3.3. 三角函数

      * 9.3.4. 双曲函数

      * 9.3.5. 分类函数

      * 9.3.6. 常量

    * 9.4. "decimal" — 十进制定点和浮点运算

      * 9.4.1. 快速入门教程

      * 9.4.2. Decimal 对象

        * 9.4.2.1. 逻辑操作数

      * 9.4.3. Context 对象

      * 9.4.4. 信号

      * 9.4.5. 浮点数说明

        * 9.4.5.1. 通过提升精度来缓解舍入误差

        * 9.4.5.2. 特殊的值

      * 9.4.6. 使用线程

      * 9.4.7. 例程

      * 9.4.8. Decimal FAQ

    * 9.5. "fractions" — 分数

    * 9.6. "random" — 生成伪随机数

    * 9.7. "itertools" — 为高效循环而创建迭代器的函数

      * 9.7.1. Itertool函数

      * 9.7.2. Recipes

    * 9.8. "functools" — 高阶函数和可调用对象上的操作

      * 9.8.1. "partial" 对象

    * 9.9. "operator" — 标准运算符替代函数

      * 9.9.1. 将运算符映射到函数

  * 10. 文件和目录访问

    * 10.1. "os.path" — 常见路径操作

    * 10.2. "fileinput" — 迭代来自多个输入流的行

    * 10.3. "stat" — 解析 "stat()" 结果

    * 10.4. "statvfs" — Constants used with "os.statvfs()"

    * 10.5. "filecmp" — 文件及目录的比较

      * 10.5.1. "dircmp" 类

    * 10.6. "tempfile" — 生成临时文件和目录

    * 10.7. "glob" — Unix 风格路径名模式扩展

    * 10.8. "fnmatch" — Unix 文件名模式匹配

    * 10.9. "linecache" — 随机读写文本行

    * 10.10. "shutil" — 高阶文件操作

      * 10.10.1. 目录和文件操作

        * 10.10.1.1. copytree 示例

      * 10.10.2. 归档操作

        * 10.10.2.1. 归档程序示例

    * 10.11. "dircache" — Cached directory listings

    * 10.12. "macpath" — Mac OS 9 路径操作函数

  * 11. 数据持久化

    * 11.1. "pickle" —— Python 对象序列化

      * 11.1.1. 与其他 Python 模块间的关系

      * 11.1.2. 数据流格式

      * 11.1.3. Usage

      * 11.1.4. 可以被打包/解包的对象

      * 11.1.5. The pickle protocol

        * 11.1.5.1. Pickling and unpickling normal class instances

        * 11.1.5.2. Pickling and unpickling extension types

        * 11.1.5.3. Pickling and unpickling external objects

      * 11.1.6. Subclassing Unpicklers

      * 11.1.7. Example

    * 11.2. "cPickle" — A faster "pickle"

    * 11.3. "copy_reg" — Register "pickle" support functions

      * 11.3.1. Example

    * 11.4. "shelve" — Python 对象持久化

      * 11.4.1. Restrictions

      * 11.4.2. 示例

    * 11.5. "marshal" — Internal Python object serialization

    * 11.6. "anydbm" — Generic access to DBM-style databases

    * 11.7. "whichdb" — Guess which DBM module created a database

    * 11.8. "dbm" — Simple “database” interface

    * 11.9. "gdbm" — GNU’s reinterpretation of dbm

    * 11.10. "dbhash" — DBM-style interface to the BSD database
      library

      * 11.10.1. Database Objects

    * 11.11. "bsddb" — Interface to Berkeley DB library

      * 11.11.1. Hash, BTree and Record Objects

    * 11.12. "dumbdbm" — Portable DBM implementation

      * 11.12.1. Dumbdbm Objects

    * 11.13. "sqlite3" — SQLite 数据库 DB-API 2.0 接口模块

      * 11.13.1. 模块函数和常量

      * 11.13.2. 连接对象（Connection）

      * 11.13.3. Cursor 对象

      * 11.13.4. 行对象*Row*

      * 11.13.5. SQLite 与 Python 类型

        * 11.13.5.1. 概述

        * 11.13.5.2. Using adapters to store additional Python types
          in SQLite databases

          * 11.13.5.2.1. 让对象自行调整

          * 11.13.5.2.2. 注册可调用的适配器

        * 11.13.5.3. 将SQLite 值转换为自定义Python 类型

        * 11.13.5.4. 默认适配器和转换器

      * 11.13.6. 控制事务

      * 11.13.7. 有效使用 "sqlite3"

        * 11.13.7.1. 使用快捷方式

        * 11.13.7.2. 通过名称而不是索引访问索引

        * 11.13.7.3. 使用连接作为上下文管理器

      * 11.13.8. 常见问题

        * 11.13.8.1. 多线程

  * 12. 数据压缩和存档

    * 12.1. "zlib" — 与 **gzip** 兼容的压缩

    * 12.2. "gzip" — 对 **gzip** 格式的支持

      * 12.2.1. 用法示例

    * 12.3. "bz2" — Compression compatible with **bzip2**

      * 12.3.1. 文件压缩和解压

      * 12.3.2. Sequential (de)compression

      * 12.3.3. 一次性压缩或解压

    * 12.4. "zipfile" — 使用ZIP存档

      * 12.4.1. ZipFile 对象

      * 12.4.2. PyZipFile Objects

      * 12.4.3. ZipInfo Objects

      * 12.4.4. 命令行界面

        * 12.4.4.1. 命令行选项

    * 12.5. "tarfile" — 读写tar归档文件

      * 12.5.1. TarFile Objects

      * 12.5.2. TarInfo Objects

      * 12.5.3. 例子

      * 12.5.4. Supported tar formats

      * 12.5.5. Unicode issues

  * 13. 文件格式

    * 13.1. "csv" — CSV 文件读写

      * 13.1.1. 模块内容

      * 13.1.2. 变种与格式参数

      * 13.1.3. Reader 对象

      * 13.1.4. Writer 对象

      * 13.1.5. 例子

    * 13.2. "ConfigParser" — Configuration file parser

      * 13.2.1. RawConfigParser Objects

      * 13.2.2. ConfigParser Objects

      * 13.2.3. SafeConfigParser Objects

      * 13.2.4. Examples

    * 13.3. "robotparser" —  Parser for robots.txt

    * 13.4. "netrc" — netrc file processing

      * 13.4.1. netrc Objects

    * 13.5. "xdrlib" — Encode and decode XDR data

      * 13.5.1. Packer Objects

      * 13.5.2. Unpacker Objects

      * 13.5.3. 异常

    * 13.6. "plistlib" — Generate and parse Mac OS X ".plist" files

      * 13.6.1. 例子

  * 14. 加密服务

    * 14.1. "hashlib" — 安全哈希与消息摘要

      * 14.1.1. Key derivation

    * 14.2. "hmac" — 基于密钥的消息验证

    * 14.3. "md5" — MD5 message digest algorithm

    * 14.4. "sha" — SHA-1 message digest algorithm

  * 15. 通用操作系统服务

    * 15.1. "os" — 操作系统接口模块

      * 15.1.1. 进程参数

      * 15.1.2. 创建文件对象

      * 15.1.3. 文件描述符操作

        * 15.1.3.1. "open()" flag constants

      * 15.1.4. 文件和目录

      * 15.1.5. Process Management

      * 15.1.6. Miscellaneous System Information

      * 15.1.7. Miscellaneous Functions

    * 15.2. "io" — 处理流的核心工具

      * 15.2.1. Module Interface

      * 15.2.2. I/O 基类

      * 15.2.3. 原始文件 I/O

      * 15.2.4. 缓冲流

      * 15.2.5. 文本 I/O

      * 15.2.6. Advanced topics

        * 15.2.6.1. 性能

          * 15.2.6.1.1. 二进制 I/O

          * 15.2.6.1.2. 文本 I/O

        * 15.2.6.2. 多线程

        * 15.2.6.3. 可重入性

    * 15.3. "time" — 时间的访问和转换

    * 15.4. "argparse" — 命令行选项、参数和子命令解析器

      * 15.4.1. 示例

        * 15.4.1.1. 创建一个解析器

        * 15.4.1.2. 添加参数

        * 15.4.1.3. 解析参数

      * 15.4.2. ArgumentParser 对象

        * 15.4.2.1. prog

        * 15.4.2.2. usage

        * 15.4.2.3. 描述

        * 15.4.2.4. epilog

        * 15.4.2.5. parents

        * 15.4.2.6. formatter_class

        * 15.4.2.7. prefix_chars

        * 15.4.2.8. fromfile_prefix_chars

        * 15.4.2.9. argument_default

        * 15.4.2.10. conflict_handler

        * 15.4.2.11. add_help

      * 15.4.3. add_argument() 方法

        * 15.4.3.1. name or flags

        * 15.4.3.2. action

        * 15.4.3.3. nargs

        * 15.4.3.4. const

        * 15.4.3.5. 默认值

        * 15.4.3.6. type – 类型

        * 15.4.3.7. choices

        * 15.4.3.8. required

        * 15.4.3.9. help

        * 15.4.3.10. metavar

        * 15.4.3.11. dest

        * 15.4.3.12. Action classes

      * 15.4.4. parse_args() 方法

        * 15.4.4.1. Option value syntax

        * 15.4.4.2. 无效的参数

        * 15.4.4.3. 包含 "-" 的参数

        * 15.4.4.4. 参数缩写（前缀匹配）

        * 15.4.4.5. Beyond "sys.argv"

        * 15.4.4.6. 命名空间对象

      * 15.4.5. 其它实用工具

        * 15.4.5.1. 子命令

        * 15.4.5.2. FileType 对象

        * 15.4.5.3. 参数组

        * 15.4.5.4. Mutual exclusion

        * 15.4.5.5. Parser defaults

        * 15.4.5.6. 打印帮助

        * 15.4.5.7. Partial parsing

        * 15.4.5.8. 自定义文件解析

        * 15.4.5.9. 退出方法

      * 15.4.6. 升级 optparse 代码

    * 15.5. "optparse" — 解析器的命令行选项

      * 15.5.1. 背景

        * 15.5.1.1. 术语

        * 15.5.1.2. What are options for?

        * 15.5.1.3. 位置位置

      * 15.5.2. 教程

        * 15.5.2.1. Understanding option actions

        * 15.5.2.2. The store action

        * 15.5.2.3. Handling boolean (flag) options

        * 15.5.2.4. Other actions

        * 15.5.2.5. 默认值

        * 15.5.2.6. Generating help

          * 15.5.2.6.1. Grouping Options

        * 15.5.2.7. Printing a version string

        * 15.5.2.8. How "optparse" handles errors

        * 15.5.2.9. Putting it all together

      * 15.5.3. 参考指南

        * 15.5.3.1. 创建解析器

        * 15.5.3.2. 填充解析器

        * 15.5.3.3. 定义选项

        * 15.5.3.4. Option attributes

        * 15.5.3.5. Standard option actions

        * 15.5.3.6. Standard option types

        * 15.5.3.7. 解析参数

        * 15.5.3.8. Querying and manipulating your option parser

        * 15.5.3.9. Conflicts between options

        * 15.5.3.10. 清理

        * 15.5.3.11. Other methods

      * 15.5.4. Option Callbacks

        * 15.5.4.1. Defining a callback option

        * 15.5.4.2. How callbacks are called

        * 15.5.4.3. Raising errors in a callback

        * 15.5.4.4. Callback example 1: trivial callback

        * 15.5.4.5. Callback example 2: check option order

        * 15.5.4.6. Callback example 3: check option order
          (generalized)

        * 15.5.4.7. Callback example 4: check arbitrary condition

        * 15.5.4.8. Callback example 5: fixed arguments

        * 15.5.4.9. Callback example 6: variable arguments

      * 15.5.5. Extending "optparse"

        * 15.5.5.1. Adding new types

        * 15.5.5.2. Adding new actions

    * 15.6. "getopt" — C-style parser for command line options

    * 15.7. 模块 "logging" — Python 的日志记录工具

      * 15.7.1. Logger 对象

      * 15.7.2. 日志级别

      * 15.7.3. 处理器对象

      * 15.7.4. Formatter Objects

      * 15.7.5. Filter Objects

      * 15.7.6. LogRecord Objects

      * 15.7.7. LogRecord 属性

      * 15.7.8. LoggerAdapter 对象

      * 15.7.9. 线程安全

      * 15.7.10. 模块级别函数

      * 15.7.11. Integration with the warnings module

    * 15.8. "logging.config" — 日志记录配置

      * 15.8.1. Configuration functions

      * 15.8.2. Configuration dictionary schema

        * 15.8.2.1. Dictionary Schema Details

        * 15.8.2.2. Incremental Configuration

        * 15.8.2.3. Object connections

        * 15.8.2.4. User-defined objects

        * 15.8.2.5. Access to external objects

        * 15.8.2.6. Access to internal objects

        * 15.8.2.7. Import resolution and custom importers

      * 15.8.3. Configuration file format

    * 15.9. "logging.handlers" — 日志处理

      * 15.9.1. StreamHandler

      * 15.9.2. FileHandler

      * 15.9.3. NullHandler

      * 15.9.4. WatchedFileHandler

      * 15.9.5. RotatingFileHandler

      * 15.9.6. TimedRotatingFileHandler

      * 15.9.7. SocketHandler

      * 15.9.8. DatagramHandler

      * 15.9.9. SysLogHandler

      * 15.9.10. NTEventLogHandler

      * 15.9.11. SMTPHandler

      * 15.9.12. MemoryHandler

      * 15.9.13. HTTPHandler

    * 15.10. "getpass" — 便携式密码输入工具

    * 15.11. "curses" — 终端字符单元显示的处理

      * 15.11.1. 函数

      * 15.11.2. Window Objects

      * 15.11.3. 常量

    * 15.12. "curses.textpad" — Text input widget for curses programs

      * 15.12.1. 文本框对象

    * 15.13. "curses.ascii" — Utilities for ASCII characters

    * 15.14. "curses.panel" — A panel stack extension for curses

      * 15.14.1. 函数

      * 15.14.2. Panel Objects

    * 15.15. "platform" —  获取底层平台的标识数据

      * 15.15.1. 跨平台

      * 15.15.2. Java平台

      * 15.15.3. Windows平台

        * 15.15.3.1. Win95/98 specific

      * 15.15.4. Mac OS平台

      * 15.15.5. Unix Platforms

    * 15.16. "errno" — Standard errno system symbols

    * 15.17. "ctypes" — Python 的外部函数库

      * 15.17.1. ctypes 教程

        * 15.17.1.1. 载入动态连接库

        * 15.17.1.2. 操作导入的动态链接库中的函数

        * 15.17.1.3. 调用函数

        * 15.17.1.4. 基础数据类型

        * 15.17.1.5. 调用函数，继续

        * 15.17.1.6. 使用自定义的数据类型调用函数

        * 15.17.1.7. Specifying the required argument types (function
          prototypes)

        * 15.17.1.8. Return types

        * 15.17.1.9. Passing pointers (or: passing parameters by
          reference)

        * 15.17.1.10. Structures and unions

        * 15.17.1.11. Structure/union alignment and byte order

        * 15.17.1.12. Bit fields in structures and unions

        * 15.17.1.13. Arrays

        * 15.17.1.14. Pointers

        * 15.17.1.15. Type conversions

        * 15.17.1.16. Incomplete Types

        * 15.17.1.17. Callback functions

        * 15.17.1.18. Accessing values exported from dlls

        * 15.17.1.19. Surprises

        * 15.17.1.20. Variable-sized data types

      * 15.17.2. ctypes reference

        * 15.17.2.1. Finding shared libraries

        * 15.17.2.2. Loading shared libraries

        * 15.17.2.3. Foreign functions

        * 15.17.2.4. Function prototypes

        * 15.17.2.5. Utility functions

        * 15.17.2.6. Data types

        * 15.17.2.7. 基础数据类型

        * 15.17.2.8. Structured data types

        * 15.17.2.9. Arrays and pointers

  * 16. Optional Operating System Services

    * 16.1. "select" — Waiting for I/O 完成

      * 16.1.1. Edge and Level Trigger Polling (epoll) Objects

      * 16.1.2. Polling Objects

      * 16.1.3. Kqueue 对象

      * 16.1.4. Kevent 对象

    * 16.2. "threading" — Higher-level threading interface

      * 16.2.1. 线程对象

      * 16.2.2. 锁对象

      * 16.2.3. 递归锁对象

      * 16.2.4. 条件对象

      * 16.2.5. 信号量对象

        * 16.2.5.1. "Semaphore" 例子

      * 16.2.6. 事件对象

      * 16.2.7. 定时器对象

      * 16.2.8. Using locks, conditions, and semaphores in the "with"
        statement

      * 16.2.9. Importing in threaded code

    * 16.3. "thread" — Multiple threads of control

    * 16.4. "dummy_threading" —  可直接替代 "threading" 模块。

    * 16.5. "dummy_thread" — Drop-in replacement for the "thread"
      module

    * 16.6. "multiprocessing" — Process-based “threading” interface

      * 16.6.1. 概述

        * 16.6.1.1. "Process" 类

        * 16.6.1.2. 在进程之间交换对象

        * 16.6.1.3. 进程之间的同步

        * 16.6.1.4. 在进程之间共享状态

        * 16.6.1.5. 使用工作进程

      * 16.6.2. 参考

        * 16.6.2.1. "Process" 和异常

        * 16.6.2.2. 管道和队列

        * 16.6.2.3. 杂项

        * 16.6.2.4. 连接对象（Connection）

        * 16.6.2.5. 同步原语

        * 16.6.2.6. 共享 "ctypes" 对象

          * 16.6.2.6.1. "multiprocessing.sharedctypes" 模块

        * 16.6.2.7. 数据管理器

          * 16.6.2.7.1. 自定义管理器

          * 16.6.2.7.2. 使用远程管理器

        * 16.6.2.8. 代理对象

          * 16.6.2.8.1. 清理

        * 16.6.2.9. 进程池

        * 16.6.2.10. 监听者及客户端

          * 16.6.2.10.1. 地址格式

        * 16.6.2.11. 认证密码

        * 16.6.2.12. 日志记录

        * 16.6.2.13. "multiprocessing.dummy" 模块

      * 16.6.3. 编程指导

        * 16.6.3.1. All platforms

        * 16.6.3.2. Windows

      * 16.6.4. 例子

    * 16.7. "mmap" — 内存映射文件支持

    * 16.8. "readline" — GNU readline 接口

      * 16.8.1. 初始化文件

      * 16.8.2. 行缓冲区

      * 16.8.3. 历史文件

      * 16.8.4. 历史列表

      * 16.8.5. 启动钩子

      * 16.8.6. Completion

      * 16.8.7. 示例

    * 16.9. "rlcompleter" — GNU readline 的补全函数

      * 16.9.1. Completer 对象

  * 17. Interprocess Communication and Networking

    * 17.1. "subprocess" — 子进程管理

      * 17.1.1. 使用 "subprocess" 模块

        * 17.1.1.1. 常用参数

        * 17.1.1.2. Popen 构造函数

        * 17.1.1.3. 异常

        * 17.1.1.4. Security

      * 17.1.2. Popen 对象

      * 17.1.3. Windows Popen 助手

        * 17.1.3.1. Constants

      * 17.1.4. Replacing Older Functions with the "subprocess" Module

        * 17.1.4.1. Replacing /bin/sh shell backquote

        * 17.1.4.2. Replacing shell pipeline

        * 17.1.4.3. Replacing "os.system()"

        * 17.1.4.4. Replacing the "os.spawn" family

        * 17.1.4.5. Replacing "os.popen()", "os.popen2()",
          "os.popen3()"

        * 17.1.4.6. Replacing functions from the "popen2" module

      * 17.1.5. 注释

        * 17.1.5.1. Converting an argument sequence to a string on
          Windows

    * 17.2. "socket" — 底层网络接口

      * 17.2.1. Socket Objects

      * 17.2.2. 示例

    * 17.3. "ssl" — TLS/SSL wrapper for socket objects

      * 17.3.1. Functions, Constants, and Exceptions

        * 17.3.1.1. Socket creation

        * 17.3.1.2. 上下文创建

        * 17.3.1.3. Random generation

        * 17.3.1.4. Certificate handling

        * 17.3.1.5. 常量

      * 17.3.2. SSL Sockets

      * 17.3.3. SSL Contexts

      * 17.3.4. Certificates

        * 17.3.4.1. Certificate chains

        * 17.3.4.2. CA certificates

        * 17.3.4.3. Combined key and certificate

        * 17.3.4.4. Self-signed certificates

      * 17.3.5. 例子

        * 17.3.5.1. Testing for SSL support

        * 17.3.5.2. Client-side operation

        * 17.3.5.3. Server-side operation

      * 17.3.6. Notes on non-blocking sockets

      * 17.3.7. Security considerations

        * 17.3.7.1. Best defaults

        * 17.3.7.2. Manual settings

          * 17.3.7.2.1. Verifying certificates

          * 17.3.7.2.2. Protocol versions

          * 17.3.7.2.3. Cipher selection

        * 17.3.7.3. Multi-processing

      * 17.3.8. LibreSSL support

    * 17.4. "signal" — 设置异步事件处理程序

      * 17.4.1. 示例

    * 17.5. "popen2" — Subprocesses with accessible I/O streams

      * 17.5.1. Popen3 and Popen4 Objects

      * 17.5.2. Flow Control Issues

    * 17.6. "asyncore" — 异步socket处理器

      * 17.6.1. asyncore Example basic HTTP client

      * 17.6.2. asyncore Example basic echo server

    * 17.7. "asynchat" — 异步 socket 指令/响应 处理器

      * 17.7.1. asynchat - Auxiliary Classes

      * 17.7.2. asynchat Example

  * 18. 互联网数据处理

    * 18.1. "email" — 电子邮件与 MIME 处理包

      * 18.1.1. "email.message": Representing an email message

      * 18.1.2. "email.parser": Parsing email messages

        * 18.1.2.1. FeedParser API

        * 18.1.2.2. Parser class API

        * 18.1.2.3. Additional notes

      * 18.1.3. "email.generator": Generating MIME documents

      * 18.1.4. "email.mime": Creating email and MIME objects from
        scratch

      * 18.1.5. "email.header": Internationalized headers

      * 18.1.6. "email.charset": Representing character sets

      * 18.1.7. "email.encoders": 编码器

      * 18.1.8. "email.errors": 异常和缺陷类

      * 18.1.9. "email.utils": 其他工具

      * 18.1.10. "email.iterators": 迭代器

      * 18.1.11. "email": Examples

      * 18.1.12. Package History

      * 18.1.13. Differences from "mimelib"

    * 18.2. "json" — JSON 编码和解码器

      * 18.2.1. 基本使用

      * 18.2.2. 编码器和解码器

      * 18.2.3. Standard Compliance and Interoperability

        * 18.2.3.1. Character Encodings

        * 18.2.3.2. Infinite and NaN Number Values

        * 18.2.3.3. Repeated Names Within an Object

        * 18.2.3.4. Top-level Non-Object, Non-Array Values

        * 18.2.3.5. Implementation Limitations

    * 18.3. "mailcap" — Mailcap file handling

    * 18.4. "mailbox" — Manipulate mailboxes in various formats

      * 18.4.1. "Mailbox" 对象

        * 18.4.1.1. "Maildir"

        * 18.4.1.2. "mbox"

        * 18.4.1.3. "MH"

        * 18.4.1.4. "Babyl"

        * 18.4.1.5. "MMDF"

      * 18.4.2. "Message" objects

        * 18.4.2.1. "MaildirMessage"

        * 18.4.2.2. "mboxMessage"

        * 18.4.2.3. "MHMessage"

        * 18.4.2.4. "BabylMessage"

        * 18.4.2.5. "MMDFMessage"

      * 18.4.3. 异常

      * 18.4.4. Deprecated classes and methods

      * 18.4.5. 例子

    * 18.5. "mhlib" — Access to MH mailboxes

      * 18.5.1. MH Objects

      * 18.5.2. Folder Objects

      * 18.5.3. Message Objects

    * 18.6. "mimetools" — Tools for parsing MIME messages

      * 18.6.1. Additional Methods of Message Objects

    * 18.7. "mimetypes" — Map filenames to MIME types

      * 18.7.1. MimeTypes Objects

    * 18.8. "MimeWriter" — Generic MIME file writer

      * 18.8.1. MimeWriter Objects

    * 18.9. "mimify" — MIME processing of mail messages

    * 18.10. "multifile" — Support for files containing distinct parts

      * 18.10.1. MultiFile Objects

      * 18.10.2. "MultiFile" Example

    * 18.11. "rfc822" — Parse RFC 2822 mail headers

      * 18.11.1. Message Objects

      * 18.11.2. AddressList Objects

    * 18.12. "base64" — RFC 3548: Base16, Base32, Base64 Data
      Encodings

    * 18.13. "binhex" — 对binhex4文件进行编码和解码

      * 18.13.1. 注释

    * 18.14. "binascii" — 二进制和 ASCII 码互转

    * 18.15. "quopri" — 编码与解码经过 MIME 转码的可打印数据

    * 18.16. "uu" — 对 uuencode 文件进行编码与解码

  * 19. 结构化标记处理工具

    * 19.1. "HTMLParser" — Simple HTML and XHTML parser

      * 19.1.1. Example HTML Parser Application

      * 19.1.2. "HTMLParser" Methods

      * 19.1.3. Examples

    * 19.2. "sgmllib" — Simple SGML parser

    * 19.3. "htmllib" — A parser for HTML documents

      * 19.3.1. HTMLParser Objects

    * 19.4. "htmlentitydefs" — Definitions of HTML general entities

    * 19.5. XML处理模块

    * 19.6. XML 漏洞

      * 19.6.1. defused packages

    * 19.7. "xml.etree.ElementTree" —  ElementTree XML API

      * 19.7.1. 教程

        * 19.7.1.1. XML树和元素

        * 19.7.1.2. 解析XML

        * 19.7.1.3. 寻找有趣的元素

        * 19.7.1.4. 修改XML文件

        * 19.7.1.5. 构建XML文档

        * 19.7.1.6. 使用命名空间解析XML

        * 19.7.1.7. 其他资源

      * 19.7.2. XPath支持

        * 19.7.2.1. 示例

        * 19.7.2.2. 支持的XPath语法

      * 19.7.3. 参考

        * 19.7.3.1. 函数

        * 19.7.3.2. 元素对象

        * 19.7.3.3. ElementTree 对象

        * 19.7.3.4. QName Objects

        * 19.7.3.5. TreeBuilder Objects

        * 19.7.3.6. XMLParser对象

    * 19.8. "xml.dom" — The Document Object Model API

      * 19.8.1. 模块内容

      * 19.8.2. Objects in the DOM

        * 19.8.2.1. DOMImplementation Objects

        * 19.8.2.2. 节点对象

        * 19.8.2.3. 节点列表对象

        * 19.8.2.4. 文档类型对象

        * 19.8.2.5. 文档对象

        * 19.8.2.6. 元素对象

        * 19.8.2.7. Attr 对象

        * 19.8.2.8. NamedNodeMap 对象

        * 19.8.2.9. 注释对象

        * 19.8.2.10. Text 和 CDATASection 对象

        * 19.8.2.11. ProcessingInstruction 对象

        * 19.8.2.12. 异常

      * 19.8.3. 一致性

        * 19.8.3.1. 类型映射

        * 19.8.3.2. Accessor Methods

    * 19.9. "xml.dom.minidom" — Minimal DOM implementation

      * 19.9.1. DOM Objects

      * 19.9.2. DOM Example

      * 19.9.3. minidom and the DOM standard

    * 19.10. "xml.dom.pulldom" — Support for building partial DOM
      trees

      * 19.10.1. DOMEventStream Objects

    * 19.11. "xml.sax" — Support for SAX2 parsers

      * 19.11.1. SAXException Objects

    * 19.12. "xml.sax.handler" — Base classes for SAX handlers

      * 19.12.1. ContentHandler 对象

      * 19.12.2. DTDHandler 对象

      * 19.12.3. EntityResolver 对象

      * 19.12.4. ErrorHandler 对象

    * 19.13. "xml.sax.saxutils" — SAX Utilities

    * 19.14. "xml.sax.xmlreader" — Interface for XML parsers

      * 19.14.1. XMLReader 对象

      * 19.14.2. IncrementalParser 对象

      * 19.14.3. Locator 对象

      * 19.14.4. InputSource 对象

      * 19.14.5. The "Attributes" Interface

      * 19.14.6. The "AttributesNS" Interface

    * 19.15. "xml.parsers.expat" — Fast XML parsing using Expat

      * 19.15.1. XMLParser对象

      * 19.15.2. ExpatError Exceptions

      * 19.15.3. 示例

      * 19.15.4. Content Model Descriptions

      * 19.15.5. Expat error constants

  * 20. 互联网协议和支持

    * 20.1. "webbrowser" — 方便的Web浏览器控制器

      * 20.1.1. 浏览器控制器对象

    * 20.2. "cgi" — Common Gateway Interface support

      * 20.2.1. 概述

      * 20.2.2. 使用cgi模块。

      * 20.2.3. Higher Level Interface

      * 20.2.4. Old classes

      * 20.2.5. 函数

      * 20.2.6. Caring about security

      * 20.2.7. Installing your CGI script on a Unix system

      * 20.2.8. Testing your CGI script

      * 20.2.9. Debugging CGI scripts

      * 20.2.10. Common problems and solutions

    * 20.3. "cgitb" — 用于 CGI 脚本的回溯管理器

    * 20.4. "wsgiref" — WSGI Utilities and Reference Implementation

      * 20.4.1. "wsgiref.util" – WSGI environment utilities

      * 20.4.2. "wsgiref.headers" – WSGI response header tools

      * 20.4.3. "wsgiref.simple_server" – a simple WSGI HTTP server

      * 20.4.4. "wsgiref.validate" — WSGI conformance checker

      * 20.4.5. "wsgiref.handlers" – server/gateway base classes

      * 20.4.6. 例子

    * 20.5. "urllib" — Open arbitrary resources by URL

      * 20.5.1. High-level interface

      * 20.5.2. Utility functions

      * 20.5.3. URL Opener objects

      * 20.5.4. "urllib" Restrictions

      * 20.5.5. Examples

    * 20.6. "urllib2" — extensible library for opening URLs

      * 20.6.1. Request Objects

      * 20.6.2. OpenerDirector Objects

      * 20.6.3. BaseHandler Objects

      * 20.6.4. HTTPRedirectHandler Objects

      * 20.6.5. HTTPCookieProcessor Objects

      * 20.6.6. ProxyHandler Objects

      * 20.6.7. HTTPPasswordMgr Objects

      * 20.6.8. AbstractBasicAuthHandler Objects

      * 20.6.9. HTTPBasicAuthHandler Objects

      * 20.6.10. ProxyBasicAuthHandler Objects

      * 20.6.11. AbstractDigestAuthHandler Objects

      * 20.6.12. HTTPDigestAuthHandler Objects

      * 20.6.13. ProxyDigestAuthHandler Objects

      * 20.6.14. HTTPHandler Objects

      * 20.6.15. HTTPSHandler Objects

      * 20.6.16. FileHandler Objects

      * 20.6.17. FTPHandler Objects

      * 20.6.18. CacheFTPHandler Objects

      * 20.6.19. UnknownHandler Objects

      * 20.6.20. HTTPErrorProcessor Objects

      * 20.6.21. Examples

    * 20.7. "httplib" — HTTP protocol client

      * 20.7.1. HTTPConnection Objects

      * 20.7.2. HTTPResponse Objects

      * 20.7.3. Examples

    * 20.8. "ftplib" — FTP 协议客户端

      * 20.8.1. FTP Objects

      * 20.8.2. FTP_TLS Objects

    * 20.9. "poplib" — POP3 protocol client

      * 20.9.1. POP3 Objects

      * 20.9.2. POP3 Example

    * 20.10. "imaplib" — IMAP4 protocol client

      * 20.10.1. IMAP4 Objects

      * 20.10.2. IMAP4 Example

    * 20.11. "nntplib" — NNTP protocol client

      * 20.11.1. NNTP Objects

    * 20.12. "smtplib" —SMTP协议客户端

      * 20.12.1. SMTP Objects

      * 20.12.2. SMTP Example

    * 20.13. "smtpd" — SMTP 服务器

      * 20.13.1. SMTPServer 对象

      * 20.13.2. DebuggingServer 对象

      * 20.13.3. PureProxy对象

      * 20.13.4. MailmanProxy 对象

    * 20.14. "telnetlib" — Telnet client

      * 20.14.1. Telnet Objects

      * 20.14.2. Telnet Example

    * 20.15. "uuid" — UUID objects according to RFC 4122

      * 20.15.1. 示例

    * 20.16. "urlparse" — Parse URLs into components

      * 20.16.1. Results of "urlparse()" and "urlsplit()"

    * 20.17. "SocketServer" — A framework for network servers

      * 20.17.1. Server Creation Notes

      * 20.17.2. Server Objects

      * 20.17.3. Request Handler Objects

      * 20.17.4. 例子

        * 20.17.4.1. "SocketServer.TCPServer" Example

        * 20.17.4.2. "SocketServer.UDPServer" Example

        * 20.17.4.3. Asynchronous Mixins

    * 20.18. "BaseHTTPServer" — Basic HTTP server

      * 20.18.1. More examples

    * 20.19. "SimpleHTTPServer" — Simple HTTP request handler

    * 20.20. "CGIHTTPServer" — CGI-capable HTTP request handler

    * 20.21. "cookielib" — Cookie handling for HTTP clients

      * 20.21.1. CookieJar and FileCookieJar Objects

      * 20.21.2. FileCookieJar subclasses and co-operation with web
        browsers

      * 20.21.3. CookiePolicy Objects

      * 20.21.4. DefaultCookiePolicy Objects

      * 20.21.5. Cookie Objects

      * 20.21.6. Examples

    * 20.22. "Cookie" — HTTP state management

      * 20.22.1. Cookie Objects

      * 20.22.2. Morsel Objects

      * 20.22.3. Example

    * 20.23. "xmlrpclib" — XML-RPC client access

      * 20.23.1. ServerProxy Objects

      * 20.23.2. Boolean Objects

      * 20.23.3. DateTime Objects

      * 20.23.4. Binary Objects

      * 20.23.5. Fault Objects

      * 20.23.6. ProtocolError Objects

      * 20.23.7. MultiCall Objects

      * 20.23.8. Convenience Functions

      * 20.23.9. Example of Client Usage

      * 20.23.10. Example of Client and Server Usage

    * 20.24. "SimpleXMLRPCServer" — Basic XML-RPC server

      * 20.24.1. SimpleXMLRPCServer Objects

        * 20.24.1.1. SimpleXMLRPCServer Example

      * 20.24.2. CGIXMLRPCRequestHandler

    * 20.25. "DocXMLRPCServer" — Self-documenting XML-RPC server

      * 20.25.1. DocXMLRPCServer Objects

      * 20.25.2. DocCGIXMLRPCRequestHandler

  * 21. 多媒体服务

    * 21.1. "audioop" — Manipulate raw audio data

    * 21.2. "imageop" — Manipulate raw image data

    * 21.3. "aifc" — Read and write AIFF and AIFC files

    * 21.4. "sunau" — 读写 Sun AU 文件

      * 21.4.1. AU_read 对象

      * 21.4.2. AU_write 对象

    * 21.5. "wave" — 读写WAV格式文件

      * 21.5.1. Wave_read对象

      * 21.5.2. Wave_write 对象

    * 21.6. "chunk" — Read IFF chunked data

    * 21.7. "colorsys" — 颜色系统间的转换

    * 21.8. "imghdr" — 推测图像类型

    * 21.9. "sndhdr" — 推测声音文件的类型

    * 21.10. "ossaudiodev" — Access to OSS-compatible audio devices

      * 21.10.1. Audio Device Objects

      * 21.10.2. Mixer Device Objects

  * 22. 国际化

    * 22.1. "gettext" — 多语种国际化服务

      * 22.1.1. GNU **gettext** API

      * 22.1.2. Class-based API

        * 22.1.2.1. The "NullTranslations" class

        * 22.1.2.2. The "GNUTranslations" class

        * 22.1.2.3. Solaris message catalog support

        * 22.1.2.4. The Catalog constructor

      * 22.1.3. Internationalizing your programs and modules

        * 22.1.3.1. Localizing your module

        * 22.1.3.2. Localizing your application

        * 22.1.3.3. Changing languages on the fly

        * 22.1.3.4. Deferred translations

        * 22.1.3.5. "gettext()" vs. "lgettext()"

      * 22.1.4. 致谢

    * 22.2. "locale" — 国际化服务

      * 22.2.1. Background, details, hints, tips and caveats

      * 22.2.2. For extension writers and programs that embed Python

      * 22.2.3. Access to message catalogs

  * 23. 程序框架

    * 23.1. "cmd" — 支持面向行的命令解释器

      * 23.1.1. Cmd 对象

    * 23.2. "shlex" — Simple lexical analysis

      * 23.2.1. shlex Objects

      * 23.2.2. Parsing Rules

  * 24. Tk图形用户界面(GUI)

    * 24.1. "Tkinter" — Python interface to Tcl/Tk

      * 24.1.1. Tkinter 模块

      * 24.1.2. Tkinter Life Preserver

        * 24.1.2.1. How To Use This Section

        * 24.1.2.2. A Simple Hello World Program

      * 24.1.3. A (Very) Quick Look at Tcl/Tk

      * 24.1.4. Mapping Basic Tk into Tkinter

      * 24.1.5. How Tk and Tkinter are Related

      * 24.1.6. Handy Reference

        * 24.1.6.1. Setting Options

        * 24.1.6.2. The Packer

        * 24.1.6.3. Packer Options

        * 24.1.6.4. Coupling Widget Variables

        * 24.1.6.5. The Window Manager

        * 24.1.6.6. Tk Option Data Types

        * 24.1.6.7. Bindings and Events

        * 24.1.6.8. The index Parameter

        * 24.1.6.9. Images

      * 24.1.7. File Handlers

    * 24.2. "ttk" — Tk themed widgets

      * 24.2.1. Using Ttk

      * 24.2.2. Ttk Widgets

      * 24.2.3. Widget

        * 24.2.3.1. Standard Options

        * 24.2.3.2. Scrollable Widget Options

        * 24.2.3.3. Label Options

        * 24.2.3.4. Compatibility Options

        * 24.2.3.5. Widget States

        * 24.2.3.6. ttk.Widget

      * 24.2.4. Combobox

        * 24.2.4.1. Options

        * 24.2.4.2. Virtual events

        * 24.2.4.3. ttk.Combobox

      * 24.2.5. Notebook

        * 24.2.5.1. Options

        * 24.2.5.2. Tab Options

        * 24.2.5.3. Tab Identifiers

        * 24.2.5.4. Virtual Events

        * 24.2.5.5. ttk.Notebook

      * 24.2.6. Progressbar

        * 24.2.6.1. Options

        * 24.2.6.2. ttk.Progressbar

      * 24.2.7. Separator

        * 24.2.7.1. Options

      * 24.2.8. Sizegrip

        * 24.2.8.1. Platform-specific notes

        * 24.2.8.2. Bugs

      * 24.2.9. Treeview

        * 24.2.9.1. Options

        * 24.2.9.2. Item Options

        * 24.2.9.3. Tag Options

        * 24.2.9.4. Column Identifiers

        * 24.2.9.5. Virtual Events

        * 24.2.9.6. ttk.Treeview

      * 24.2.10. Ttk Styling

        * 24.2.10.1. Layouts

    * 24.3. "Tix" — Extension widgets for Tk

      * 24.3.1. Using Tix

      * 24.3.2. Tix Widgets

        * 24.3.2.1. Basic Widgets

        * 24.3.2.2. File Selectors

        * 24.3.2.3. Hierarchical ListBox

        * 24.3.2.4. Tabular ListBox

        * 24.3.2.5. Manager Widgets

        * 24.3.2.6. Image Types

        * 24.3.2.7. Miscellaneous Widgets

        * 24.3.2.8. Form Geometry Manager

      * 24.3.3. Tix Commands

    * 24.4. "ScrolledText" — Scrolled Text Widget

    * 24.5. "turtle" — Turtle graphics for Tk

      * 24.5.1. 概述

      * 24.5.2. Overview over available Turtle and Screen methods

        * 24.5.2.1. Turtle 方法

        * 24.5.2.2. TurtleScreen/Screen 方法

      * 24.5.3. RawTurtle/Turtle 方法和对应函数

        * 24.5.3.1. 海龟动作

        * 24.5.3.2. 获取海龟的状态

        * 24.5.3.3. 度量单位设置

        * 24.5.3.4. 画笔控制

          * 24.5.3.4.1. 绘图状态

          * 24.5.3.4.2. 颜色控制

          * 24.5.3.4.3. 填充

          * 24.5.3.4.4. 更多绘图控制

        * 24.5.3.5. 海龟状态

          * 24.5.3.5.1. 可见性

          * 24.5.3.5.2. 外观

        * 24.5.3.6. 使用事件

        * 24.5.3.7. 特殊海龟方法

        * 24.5.3.8. Excursus about the use of compound shapes

      * 24.5.4. TurtleScreen/Screen 方法及对应函数

        * 24.5.4.1. 窗口控制

        * 24.5.4.2. 动画控制

        * 24.5.4.3. 使用屏幕事件

        * 24.5.4.4. 设置与特殊方法

        * 24.5.4.5. Screen 专有方法, 而非继承自 TurtleScreen

      * 24.5.5. The public classes of the module "turtle"

      * 24.5.6. 帮助与配置

        * 24.5.6.1. 如何使用帮助

        * 24.5.6.2. 文档字符串翻译为不同的语言

        * 24.5.6.3. 如何配置 Screen 和 Turtle

      * 24.5.7. Demo scripts

    * 24.6. IDLE

      * 24.6.1. 目录

        * 24.6.1.1. 文件目录 （命令行和编辑器）

        * 24.6.1.2. 编辑目录（命令行和编辑器）

        * 24.6.1.3. 格式菜单（仅 window 编辑器）

        * 24.6.1.4. 运行菜单（仅 window 编辑器）

        * 24.6.1.5. Shell 菜单（仅 window 编辑器）

        * 24.6.1.6. 调试菜单（仅 window 编辑器）

        * 24.6.1.7. 选项菜单（命令行和编辑器）

        * 24.6.1.8. Window 菜单（命令行和编辑器）

        * 24.6.1.9. 帮助菜单（命令行和编辑器）

        * 24.6.1.10. 上下文菜单

      * 24.6.2. 编辑和导航

        * 24.6.2.1. 自动缩进

        * 24.6.2.2. 完成

        * 24.6.2.3. 提示

        * 24.6.2.4. Python Shell 窗口

        * 24.6.2.5. 文本颜色

      * 24.6.3. 启动和代码执行

        * 24.6.3.1. 命令行语法

        * 24.6.3.2. IDLE-console differences

        * 24.6.3.3. 在没有子进程的情况下运行

      * 24.6.4. 帮助和偏好

        * 24.6.4.1. Additional help sources

        * 24.6.4.2. 偏好设定

        * 24.6.4.3. 扩展

    * 24.7. 其他图形用户界面（GUI）包

  * 25. 开发工具

    * 25.1. "pydoc" — Documentation generator and online help system

    * 25.2. "doctest" — 测试交互性的Python示例

      * 25.2.1. 简单用法：检查Docstrings中的示例

      * 25.2.2. Simple Usage: Checking Examples in a Text File

      * 25.2.3. How It Works

        * 25.2.3.1. Which Docstrings Are Examined?

        * 25.2.3.2. How are Docstring Examples Recognized?

        * 25.2.3.3. What’s the Execution Context?

        * 25.2.3.4. What About Exceptions?

        * 25.2.3.5. Option Flags

        * 25.2.3.6. Directives

        * 25.2.3.7. 警告

      * 25.2.4. Basic API

      * 25.2.5. Unittest API

      * 25.2.6. Advanced API

        * 25.2.6.1. DocTest 对象

        * 25.2.6.2. Example Objects

        * 25.2.6.3. DocTestFinder 对象

        * 25.2.6.4. DocTestParser 对象

        * 25.2.6.5. DocTestRunner 对象

        * 25.2.6.6. OutputChecker 对象

      * 25.2.7. 调试

      * 25.2.8. Soapbox

    * 25.3. "unittest" — 单元测试框架

      * 25.3.1. 基本实例

      * 25.3.2. 命令行界面

        * 25.3.2.1. 命令行选项

      * 25.3.3. 探索性测试

      * 25.3.4. 组织你的测试代码

      * 25.3.5. 复用已有的测试代码

      * 25.3.6. 跳过测试与预计的失败

      * 25.3.7. 类与函数

        * 25.3.7.1. 测试用例

          * 25.3.7.1.1. Deprecated aliases

        * 25.3.7.2. Grouping tests

        * 25.3.7.3. Loading and running tests

          * 25.3.7.3.1. load_tests Protocol

      * 25.3.8. Class and Module Fixtures

        * 25.3.8.1. setUpClass and tearDownClass

        * 25.3.8.2. setUpModule and tearDownModule

      * 25.3.9. Signal Handling

    * 25.4. 2to3 - 自动将 Python 2 代码转为 Python 3 代码

      * 25.4.1. 使用 2to3

      * 25.4.2. 修复器

      * 25.4.3. "lib2to3" —— 2to3 支持库

    * 25.5. "test" — Regression tests package for Python

      * 25.5.1. Writing Unit Tests for the "test" package

      * 25.5.2. Running tests using the command-line interface

    * 25.6. "test.support" — Utility functions for tests

  * 26. 调试和分析

    * 26.1. "bdb" — Debugger framework

    * 26.2. "pdb" — Python的调试器

    * 26.3. Debugger Commands

    * 26.4. Python 分析器

      * 26.4.1. 分析器简介

      * 26.4.2. 即时用户手册

      * 26.4.3. "profile" 和 "cProfile" 模块参考

      * 26.4.4. "Stats" 类

      * 26.4.5. 什么是确定性性能分析？

      * 26.4.6. 局限性

      * 26.4.7. 准确估量

      * 26.4.8. 使用自定义计时器

    * 26.5. "hotshot" — High performance logging profiler

      * 26.5.1. Profile Objects

      * 26.5.2. Using hotshot data

      * 26.5.3. Example Usage

    * 26.6. "timeit" — 测量小代码片段的执行时间

      * 26.6.1. 基本示例

      * 26.6.2. Python 接口

      * 26.6.3. 命令行界面

      * 26.6.4. 例子

    * 26.7. "trace" — Trace or track Python statement execution

      * 26.7.1. Command-Line Usage

        * 26.7.1.1. Main options

        * 26.7.1.2. Modifiers

        * 26.7.1.3. Filters

      * 26.7.2. Programmatic Interface

  * 27. 软件打包和分发

    * 27.1. "distutils" — 构建和安装 Python 模块

    * 27.2. "ensurepip" — Bootstrapping the "pip" installer

      * 27.2.1. Command line interface

      * 27.2.2. Module API

  * 28. Python运行时服务

    * 28.1. "sys" — 系统相关的参数和函数

    * 28.2. "sysconfig" — Provide access to Python’s configuration
      information

      * 28.2.1. 配置变量

      * 28.2.2. 安装路径

      * 28.2.3. 其他功能

    * 28.3. "__builtin__" — Built-in objects

    * 28.4. "future_builtins" — Python 3 builtins

    * 28.5. "__main__" — 顶层脚本环境

    * 28.6. "warnings" — Warning control

      * 28.6.1. 警告类别

      * 28.6.2. The Warnings Filter

        * 28.6.2.1. Default Warning Filters

      * 28.6.3. 暂时禁止警告

      * 28.6.4. 测试警告

      * 28.6.5. Updating Code For New Versions of Python

      * 28.6.6. Available Functions

      * 28.6.7. Available Context Managers

    * 28.7. "contextlib" — Utilities for "with"-statement contexts

    * 28.8. "abc" — 抽象基类

    * 28.9. "atexit" — 退出处理器

      * 28.9.1. "atexit" 示例

    * 28.10. "traceback" — 打印或检索堆栈回溯

      * 28.10.1. Traceback Examples

    * 28.11. "__future__" — Future 语句定义

    * 28.12. "gc" — 垃圾回收器接口

    * 28.13. "inspect" — 检查对象

      * 28.13.1. 类型和成员

      * 28.13.2. Retrieving source code

      * 28.13.3. 类与函数

      * 28.13.4. The interpreter stack

    * 28.14. "site" — Site-specific configuration hook

    * 28.15. "user" — User-specific configuration hook

    * 28.16. "fpectl" — Floating point exception control

      * 28.16.1. Example

      * 28.16.2. Limitations and other considerations

  * 29. 自定义 Python 解释器

    * 29.1. "code" — 解释器基础类

      * 29.1.1. 交互解释器对象

      * 29.1.2. 交互式控制台对象

    * 29.2. "codeop" — 编译Python代码

  * 30. Restricted Execution

    * 30.1. "rexec" — Restricted execution framework

      * 30.1.1. RExec Objects

      * 30.1.2. Defining restricted environments

      * 30.1.3. An example

    * 30.2. "Bastion" — Restricting access to objects

  * 31. 导入模块

    * 31.1. "imp" — Access the "import" internals

      * 31.1.1. 例子

    * 31.2. "importlib" — Convenience wrappers for "__import__()"

    * 31.3. "imputil" — Import utilities

      * 31.3.1. Examples

    * 31.4. "zipimport" — Import modules from Zip archives

      * 31.4.1. zipimporter Objects

      * 31.4.2. 例子

    * 31.5. "pkgutil" — Package extension utility

    * 31.6. "modulefinder" — 查找脚本使用的模块

      * 31.6.1. "ModuleFinder" 的示例用法

    * 31.7. "runpy" — Locating and executing Python modules

  * 32. Python 语言服务

    * 32.1. "parser" — Access Python parse trees

      * 32.1.1. Creating ST Objects

      * 32.1.2. Converting ST Objects

      * 32.1.3. Queries on ST Objects

      * 32.1.4. Exceptions and Error Handling

      * 32.1.5. ST Objects

      * 32.1.6. Example: Emulation of "compile()"

    * 32.2. "ast" — 抽象语法树

      * 32.2.1. 节点类

      * 32.2.2. 抽象文法

      * 32.2.3. "ast" 中的辅助函数

    * 32.3. "symtable" — Access to the compiler’s symbol tables

      * 32.3.1. Generating Symbol Tables

      * 32.3.2. Examining Symbol Tables

    * 32.4. "symbol" — 与 Python 解析树一起使用的常量

    * 32.5. "token" — 与Python解析树一起使用的常量

    * 32.6. "keyword" — 检验Python关键字

    * 32.7. "tokenize" — Tokenizer for Python source

    * 32.8. "tabnanny" — 模糊缩进检测

    * 32.9. "pyclbr" — Python class browser support

      * 32.9.1. 类对象

      * 32.9.2. 函数对象

    * 32.10. "py_compile" — Compile Python source files

    * 32.11. "compileall" — Byte-compile Python libraries

      * 32.11.1. Command-line use

      * 32.11.2. Public functions

    * 32.12. "dis" — Python 字节码反汇编器

      * 32.12.1. Python字节码说明

    * 32.13. "pickletools" — Tools for pickle developers

  * 33. Python compiler package

    * 33.1. The basic interface

    * 33.2. Limitations

    * 33.3. Python Abstract Syntax

      * 33.3.1. AST Nodes

      * 33.3.2. Assignment nodes

      * 33.3.3. Examples

    * 33.4. Using Visitors to Walk ASTs

    * 33.5. Bytecode Generation

  * 34. 杂项服务

    * 34.1. "formatter" — Generic output formatting

      * 34.1.1. The Formatter Interface

      * 34.1.2. Formatter Implementations

      * 34.1.3. The Writer Interface

      * 34.1.4. Writer Implementations

  * 35. Windows系统相关模块

    * 35.1. "msilib" — Read and write Microsoft Installer files

      * 35.1.1. Database Objects

      * 35.1.2. View Objects

      * 35.1.3. Summary Information Objects

      * 35.1.4. Record Objects

      * 35.1.5. Errors

      * 35.1.6. CAB Objects

      * 35.1.7. Directory Objects

      * 35.1.8. 相关特性

      * 35.1.9. GUI classes

      * 35.1.10. Precomputed tables

    * 35.2. "msvcrt" — Useful routines from the MS VC++ runtime

      * 35.2.1. File Operations

      * 35.2.2. Console I/O

      * 35.2.3. Other Functions

    * 35.3. "_winreg" — Windows registry access

      * 35.3.1. Constants

        * 35.3.1.1. HKEY_* Constants

        * 35.3.1.2. Access Rights

          * 35.3.1.2.1. 64-bit Specific

        * 35.3.1.3. Value Types

      * 35.3.2. Registry Handle Objects

    * 35.4. "winsound" — Sound-playing interface for Windows

  * 36. Unix 专有服务

    * 36.1. "posix" — The most common POSIX system calls

      * 36.1.1. Large File Support

      * 36.1.2. Notable Module Contents

    * 36.2. "pwd" — 用户密码数据库

    * 36.3. "spwd" — The shadow password database

    * 36.4. "grp" — The group database

    * 36.5. "crypt" — Function to check Unix passwords

    * 36.6. "dl" — Call C functions in shared objects

      * 36.6.1. Dl Objects

    * 36.7. "termios" — POSIX style tty control

      * 36.7.1. 示例

    * 36.8. "tty" — 终端控制功能

    * 36.9. "pty" — Pseudo-terminal utilities

    * 36.10. "fcntl" — The "fcntl" and "ioctl" system calls

    * 36.11. "pipes" — Interface to shell pipelines

      * 36.11.1. Template Objects

    * 36.12. "posixfile" — File-like objects with locking support

    * 36.13. "resource" — Resource usage information

      * 36.13.1. Resource Limits

      * 36.13.2. Resource Usage

    * 36.14. "nis" — Interface to Sun’s NIS (Yellow Pages)

    * 36.15. Unix syslog 库例程

      * 36.15.1. 例子

        * 36.15.1.1. Simple example

    * 36.16. "commands" — Utilities for running commands

  * 37. Mac OS X specific services

    * 37.1. "ic" — Access to the Mac OS X Internet Config

      * 37.1.1. IC Objects

    * 37.2. "MacOS" — Access to Mac OS interpreter features

    * 37.3. "macostools" — Convenience routines for file manipulation

    * 37.4. "findertools" — The **finder**’s Apple Events interface

    * 37.5. "EasyDialogs" — Basic Macintosh dialogs

      * 37.5.1. ProgressBar Objects

    * 37.6. "FrameWork" — Interactive application framework

      * 37.6.1. Application Objects

      * 37.6.2. Window Objects

      * 37.6.3. ControlsWindow Object

      * 37.6.4. ScrolledWindow Object

      * 37.6.5. DialogWindow Objects

    * 37.7. "autoGIL" — Global Interpreter Lock handling in event
      loops

    * 37.8. Mac OS Toolbox Modules

      * 37.8.1. "Carbon.AE" — Apple Events

      * 37.8.2. "Carbon.AH" — Apple Help

      * 37.8.3. "Carbon.App" — Appearance Manager

      * 37.8.4. "Carbon.Appearance" — Appearance Manager constants

      * 37.8.5. "Carbon.CF" — Core Foundation

      * 37.8.6. "Carbon.CG" — Core Graphics

      * 37.8.7. "Carbon.CarbonEvt" — Carbon Event Manager

      * 37.8.8. "Carbon.CarbonEvents" — Carbon Event Manager constants

      * 37.8.9. "Carbon.Cm" — Component Manager

      * 37.8.10. "Carbon.Components" — Component Manager constants

      * 37.8.11. "Carbon.ControlAccessor" — Control Manager accssors

      * 37.8.12. "Carbon.Controls" — Control Manager constants

      * 37.8.13. "Carbon.CoreFounation" — CoreFounation constants

      * 37.8.14. "Carbon.CoreGraphics" — CoreGraphics constants

      * 37.8.15. "Carbon.Ctl" — Control Manager

      * 37.8.16. "Carbon.Dialogs" — Dialog Manager constants

      * 37.8.17. "Carbon.Dlg" — Dialog Manager

      * 37.8.18. "Carbon.Drag" — Drag and Drop Manager

      * 37.8.19. "Carbon.Dragconst" — Drag and Drop Manager constants

      * 37.8.20. "Carbon.Events" — Event Manager constants

      * 37.8.21. "Carbon.Evt" — Event Manager

      * 37.8.22. "Carbon.File" — File Manager

      * 37.8.23. "Carbon.Files" — File Manager constants

      * 37.8.24. "Carbon.Fm" — Font Manager

      * 37.8.25. "Carbon.Folder" — Folder Manager

      * 37.8.26. "Carbon.Folders" — Folder Manager constants

      * 37.8.27. "Carbon.Fonts" — Font Manager constants

      * 37.8.28. "Carbon.Help" — Help Manager

      * 37.8.29. "Carbon.IBCarbon" — Carbon InterfaceBuilder

      * 37.8.30. "Carbon.IBCarbonRuntime" — Carbon InterfaceBuilder
        constants

      * 37.8.31. "Carbon.Icn" — Carbon Icon Manager

      * 37.8.32. "Carbon.Icons" — Carbon Icon Manager constants

      * 37.8.33. "Carbon.Launch" — Carbon Launch Services

      * 37.8.34. "Carbon.LaunchServices" — Carbon Launch Services
        constants

      * 37.8.35. "Carbon.List" — List Manager

      * 37.8.36. "Carbon.Lists" — List Manager constants

      * 37.8.37. "Carbon.MacHelp" — Help Manager constants

      * 37.8.38. "Carbon.MediaDescr" — Parsers and generators for
        Quicktime Media descriptors

      * 37.8.39. "Carbon.Menu" — Menu Manager

      * 37.8.40. "Carbon.Menus" — Menu Manager constants

      * 37.8.41. "Carbon.Mlte" — MultiLingual Text Editor

      * 37.8.42. "Carbon.OSA" — Carbon OSA Interface

      * 37.8.43. "Carbon.OSAconst" — Carbon OSA Interface constants

      * 37.8.44. "Carbon.QDOffscreen" — QuickDraw Offscreen constants

      * 37.8.45. "Carbon.Qd" — QuickDraw

      * 37.8.46. "Carbon.Qdoffs" — QuickDraw Offscreen

      * 37.8.47. "Carbon.Qt" — QuickTime

      * 37.8.48. "Carbon.QuickDraw" — QuickDraw constants

      * 37.8.49. "Carbon.QuickTime" — QuickTime constants

      * 37.8.50. "Carbon.Res" — Resource Manager and Handles

      * 37.8.51. "Carbon.Resources" — Resource Manager and Handles
        constants

      * 37.8.52. "Carbon.Scrap" — Scrap Manager

      * 37.8.53. "Carbon.Snd" — Sound Manager

      * 37.8.54. "Carbon.Sound" — Sound Manager constants

      * 37.8.55. "Carbon.TE" — TextEdit

      * 37.8.56. "Carbon.TextEdit" — TextEdit constants

      * 37.8.57. "Carbon.Win" — Window Manager

      * 37.8.58. "Carbon.Windows" — Window Manager constants

    * 37.9. "ColorPicker" — Color selection dialog

  * 38. MacPython OSA Modules

    * 38.1. "gensuitemodule" — Generate OSA stub packages

    * 38.2. "aetools" — OSA client support

    * 38.3. "aepack" — Conversion between Python variables and
      AppleEvent data containers

    * 38.4. "aetypes" — AppleEvent objects

    * 38.5. "MiniAEFrame" — Open Scripting Architecture server support

      * 38.5.1. AEServer Objects

  * 39. SGI IRIX Specific Services

    * 39.1. "al" — Audio functions on the SGI

      * 39.1.1. Configuration Objects

      * 39.1.2. Port Objects

    * 39.2. "AL" — Constants used with the "al" module

    * 39.3. "cd" — CD-ROM access on SGI systems

      * 39.3.1. Player Objects

      * 39.3.2. Parser Objects

    * 39.4. "fl" — FORMS library for graphical user interfaces

      * 39.4.1. Functions Defined in Module "fl"

      * 39.4.2. Form Objects

      * 39.4.3. FORMS Objects

    * 39.5. "FL" — Constants used with the "fl" module

    * 39.6. "flp" — Functions for loading stored FORMS designs

    * 39.7. "fm" — *Font Manager* interface

    * 39.8. "gl" — *Graphics Library* interface

    * 39.9. "DEVICE" — Constants used with the "gl" module

    * 39.10. "GL" — Constants used with the "gl" module

    * 39.11. "imgfile" — Support for SGI imglib files

    * 39.12. "jpeg" — Read and write JPEG files

  * 40. SunOS Specific Services

    * 40.1. "sunaudiodev" — Access to Sun audio hardware

      * 40.1.1. Audio Device Objects

    * 40.2. "SUNAUDIODEV" — Constants used with "sunaudiodev"

  * 41. 未创建文档的模块

    * 41.1. Miscellaneous useful utilities

    * 41.2. 平台特定模块

    * 41.3. Multimedia

    * 41.4. Undocumented Mac OS modules

      * 41.4.1. "applesingle" — AppleSingle decoder

      * 41.4.2. "buildtools" — Helper module for BuildApplet and
        Friends

      * 41.4.3. "cfmfile" — Code Fragment Resource module

      * 41.4.4. "icopen" — Internet Config replacement for "open()"

      * 41.4.5. "macerrors" — Mac OS Errors

      * 41.4.6. "macresource" — Locate script resources

      * 41.4.7. "Nav" — NavServices calls

      * 41.4.8. "PixMapWrapper" — Wrapper for PixMap objects

      * 41.4.9. "videoreader" — Read QuickTime movies

      * 41.4.10. "W" — Widgets built on "FrameWork"

    * 41.5. Obsolete

    * 41.6. SGI-specific Extension modules

* 扩展和嵌入 Python 解释器

  * 1. 使用 C 或 C++ 扩展 Python

    * 1.1. 一个简单的例子

    * 1.2. 关于错误和异常

    * 1.3. 回到例子

    * 1.4. 模块方法表和初始化函数

    * 1.5. 编译和链接

    * 1.6. 在C中调用Python函数

    * 1.7. 提取扩展函数的参数

    * 1.8. 给扩展函数的关键字参数

    * 1.9. 构造任意值

    * 1.10. 引用计数

      * 1.10.1. Python中的引用计数

      * 1.10.2. 拥有规则

      * 1.10.3. 危险的薄冰

      * 1.10.4. NULL指针

    * 1.11. 在C++中编写扩展

    * 1.12. 给扩展模块提供C API

  * 2. Defining New Types

    * 2.1. The Basics

      * 2.1.1. Adding data and methods to the Basic example

      * 2.1.2. Providing finer control over data attributes

      * 2.1.3. Supporting cyclic garbage collection

      * 2.1.4. Subclassing other types

    * 2.2. Type Methods

      * 2.2.1. 终结和内存释放

      * 2.2.2. 对象展示

      * 2.2.3. Attribute Management

        * 2.2.3.1. 泛型属性管理

        * 2.2.3.2. Type-specific Attribute Management

      * 2.2.4. Object Comparison

      * 2.2.5. Abstract Protocol Support

      * 2.2.6. Weak Reference Support

      * 2.2.7. 更多建议

  * 3. 使用distutils构建C和C++扩展

    * 3.1. 发布你的扩展模块

  * 4. 在Windows平台编译C和C++扩展

    * 4.1. A Cookbook Approach

    * 4.2. Differences Between Unix and Windows

    * 4.3. Using DLLs in Practice

  * 5. Embedding Python in Another Application

    * 5.1. Very High Level Embedding

    * 5.2. Beyond Very High Level Embedding: An overview

    * 5.3. Pure Embedding

    * 5.4. Extending Embedded Python

    * 5.5. Embedding Python in C++

    * 5.6. Compiling and Linking under Unix-like systems

* Python/C API 参考手册

  * 概述

    * 包含文件

    * 对象、类型和引用计数

      * 引用计数

        * Reference Count Details

      * 类型

    * 异常

    * 嵌入Python

    * 调试构建

  * The Very High Level Layer

  * 引用计数

  * 异常处理

    * Unicode Exception Objects

    * Recursion Control

    * 标准异常

    * 标准警告类别

    * String Exceptions

  * 工具

    * 操作系统实用程序

    * 系统功能

    * 过程控制

    * 导入模块

    * Data marshalling support

    * 解析参数并构建值变量

    * 字符串转换与格式化

    * 反射

    * 编解码器注册与支持功能

      * Codec 查找API

      * 用于Unicode编码错误处理程序的注册表API

  * 抽象对象层

    * 对象协议

    * 数字协议

    * 序列协议

    * 映射协议

    * 迭代器协议

    * 旧缓冲协议

  * 具体的对象层

    * 基本对象

      * 类型对象

      * "None" 对象

    * 数值对象

      * Plain Integer Objects

      * 布尔对象

      * Long Integer Objects

      * 浮点数对象

      * 复数对象

        * 表示复数的C结构体

        * 表示复数的Python对象

    * 序列对象

      * 字节数组对象

        * 类型检查宏

        * 直接 API 函数

        * 宏

      * String/Bytes Objects

      * Unicode Objects and Codecs

        * Unicode对象

          * Unicode类型

          * Unicode字符属性

          * Plain Py_UNICODE

          * wchar_t Support

        * Built-in Codecs

          * Generic Codecs

          * UTF-8 Codecs

          * UTF-32 Codecs

          * UTF-16 Codecs

          * UTF-7 Codecs

          * Unicode-Escape Codecs

          * Raw-Unicode-Escape Codecs

          * Latin-1 Codecs

          * ASCII Codecs

          * Character Map Codecs

          * MBCS codecs for Windows

          * Methods & Slots

        * Methods and Slot Functions

      * Buffers and Memoryview Objects

        * The new-style Py_buffer struct

        * Buffer related functions

        * MemoryView objects

        * Old-style buffer objects

      * 元组对象

      * 列表对象

    * Mapping Objects

      * 字典对象

    * 其他对象

      * Class and Instance Objects

      * 函数对象

      * 方法对象

      * 文件对象

      * 模块对象

      * 迭代器对象

      * 描述符对象

      * 切片对象

      * Ellipsis Object

      * 弱引用对象

      * 胶囊

      * CObjects

      * Cell 对象

      * 生成器对象

      * DateTime 对象

      * 集合对象

      * 代码对象

  * Initialization, Finalization, and Threads

    * Initializing and finalizing the interpreter

    * Process-wide parameters

    * Thread State and the Global Interpreter Lock

      * Releasing the GIL from extension code

      * 非Python创建的线程

      * 高阶 API

      * Low-level API

    * Sub-interpreter support

      * 错误和警告

    * 异步通知

    * 分析和跟踪

    * 高级调试器支持

  * 内存管理

    * 概述

    * 内存接口

    * 对象分配器

    * The pymalloc allocator

    * 例子

  * 对象实现支持

    * 在堆上分配对象

    * Common Object Structures

    * 类型对象

    * Number Object Structures

    * Mapping Object Structures

    * Sequence Object Structures

    * Buffer Object Structures

    * 使对象类型支持循环垃圾回收

* 分发 Python 模块

  * 关键术语

  * 开源许可与协作

  * 安装工具

  * Reading the guide

  * 我该如何…？

    * …为我的项目选择一个名字？

    * …创建和分发二进制扩展？

* 安装 Python 模块

  * 关键术语

  * 基本使用

  * 我应如何 …？

    * … install "pip" in versions of Python prior to Python 2.7.9?

    * … 只为当前用户安装软件包？

    * … 安装科学计算类 Python 软件包？

    * … 使用并行安装的多个 Python 版本？

  * 常见的安装问题

    * 在 Linux 的系统 Python 版本上安装

    * 未安装 pip

    * 安装二进制编译扩展

* Python 常用指引

  * 将 Python 2 代码迁移到 Python 3

    * 简要说明

    * 详情

      * 删除对Python 2.6及更早版本的支持

      * Make sure you specify the proper version support in your
        "setup.py" file

      * 良好的测试覆盖率

      * 了解Python 2 和 3之间的区别

      * 更新代码

        * 除法

        * 文本与二进制数据

        * Use feature detection instead of version detection

      * Prevent compatibility regressions

      * Check which dependencies block your transition

      * Update your "setup.py" file to denote Python 3 compatibility

      * Use continuous integration to stay compatible

      * 考虑使用可选的静态类型检查

  * 将扩展模块移植到 Python 3

    * 条件编译

    * 对象API的更改

      * str/unicode 统一

      * long/int 统一

    * 模块初始化和状态

    * CObject 替换为 Capsule

    * 其他选项

  * 用 Python 进行 Curses 编程

    * curses 是什么？

      * Python 的 curses 模块

    * 开始和结束curses应用程序

    * Windows 和 Pad

    * 显示文字

      * 属性和颜色

    * 用户输入

    * 更多的信息

  * 实现描述器

    * 摘要

    * 定义和简介

    * 描述器协议

    * 发起调用描述器

    * 描述符示例

    * Properties

    * 函数和方法

    * Static Methods and Class Methods

  * Idioms and Anti-Idioms in Python

    * Language Constructs You Should Not Use

      * from module import *

        * Inside Function Definitions

        * At Module Level

        * When It Is Just Fine

      * Unadorned "exec", "execfile()" and friends

      * from module import name1, name2

      * except:

    * Exceptions

    * Using the Batteries

    * Using Backslash to Continue Statements

  * 函数式编程指引

    * 概述

      * 形式证明

      * 模块化

      * 易于调试和测试

      * 组合性

    * 迭代器

      * 支持迭代器的数据类型

    * 生成器表达式和列表推导式

    * 生成器

      * 向生成器传递值

    * 内置函数

    * 小函数和 lambda 表达式

    * itertools 模块

      * 创建新的迭代器

      * 对元素使用函数

      * 选择元素

      * 为元素分组

    * functools 模块

      * operator 模块

    * 修订记录和致谢

    * 参考文献

      * 通用文献

      * Python 相关

      * Python 文档

  * 日志 HOWTO

    * 日志基础教程

      * 什么时候使用 Logging

      * 一个简单的例子

      * 记录日志到文件

      * 从多个模块记录日志

      * 记录变量数据

      * 更改显示消息的格式

      * 在消息中显示日期/时间

      * 后续步骤

    * 进阶日志教程

      * 记录流程

      * 记录器

      * 处理程序

      * 格式化程序

      * 配置日志记录

      * 如果没有提供配置会发生什么

      * 配置库的日志记录

    * 日志级别

      * 自定义级别

    * 有用的处理程序

    * 记录日志中引发的异常

    * 使用任意对象作为消息

    * 优化

  * 日志操作手册

    * 在多个模块中记录日志

    * 在多个线程中记录日志

    * 多个日志处理器以及多种格式化器

    * 在多个地方记录日志

    * 日志服务器配置示例

    * 通过网络发送和接收日志

    * 在日志记录中添加上下文信息

      * 使用日志适配器传递上下文信息

        * 使用除字典之外的其它对象传递上下文信息

      * 使用过滤器传递上下文信息

    * 从多个进程记录至单个文件

    * 轮换日志文件

    * An example dictionary-based configuration

    * Inserting a BOM into messages sent to a SysLogHandler

    * Implementing structured logging

    * Customizing handlers with "dictConfig()"

    * Configuring filters with "dictConfig()"

    * Customized exception formatting

    * Speaking logging messages

    * 缓冲日志消息并有条件地输出它们

    * 通过配置使用UTC (GMT) 格式化时间

    * 使用上下文管理器的可选的日志记录

  * 正则表达式HOWTO

    * 概述

    * 简单模式

      * 匹配字符

      * 重复

    * 使用正则表达式

      * 编译正则表达式

      * 反斜杠灾难

      * 应用匹配

      * 模块级别函数

      * 编译标志

    * 更多模式能力

      * 更多元字符

      * 分组

      * 非捕获和命名组

      * 前向断言

    * 修改字符串

      * 分割字符串

      * 搜索和替换

    * 常见问题

      * 使用字符串方法

      * match() 和 search()

      * 贪婪与非贪婪

      * 使用 re.VERBOSE

    * 反馈

  * 套接字编程指南

    * 套接字

      * 历史

    * 创建套接字

      * 进程间通信

    * 使用一个套接字

      * 二进制数据

    * 断开连接

      * 套接字何时销毁

    * 非阻塞的套接字

      * Performance

  * 排序指南

    * 基本排序

    * 关键函数

    * Operator 模块函数

    * 升序和降序

    * 排序稳定性和排序复杂度

    * 使用装饰-排序-去装饰的旧方法

    * 使用 *cmp* 参数的旧方法

    * 其它

  * Unicode 指南

    * Unicode 概述

      * History of Character Codes

      * 定义

      * 编码

      * 参考文献

    * Python 2.x’s Unicode Support

      * The Unicode Type

      * Unicode Literals in Python Source Code

      * Unicode Properties

      * 参考文献

    * Reading and Writing Unicode Data

      * Unicode filenames

      * Tips for Writing Unicode-aware Programs

      * 参考文献

    * Revision History and Acknowledgements

  * HOWTO Fetch Internet Resources Using urllib2

    * 概述

    * 提取URL

      * 数据

      * Headers

    * 处理异常

      * URLError

      * HTTPError

        * 错误代码

      * 包装起来

        * 数字1

        * Number 2

    * info and geturl

    * Openers and Handlers

    * 基本认证

    * 代理

    * Sockets and Layers

    * 备注

  * HOWTO Use Python in the web

    * The Low-Level View

      * Common Gateway Interface

        * Simple script for testing CGI

        * Setting up CGI on your own server

        * Common problems with CGI scripts

      * mod_python

      * FastCGI and SCGI

        * Setting up FastCGI

      * mod_wsgi

    * Step back: WSGI

      * WSGI Servers

      * Case study: MoinMoin

    * Model-View-Controller

    * Ingredients for Websites

      * Templates

      * Data persistence

    * Frameworks

      * Some notable frameworks

        * Django

        * TurboGears

        * Zope

        * Other notable frameworks

  * Argparse 教程

    * 概念

    * 基础

    * 位置参数介绍

    * 可选参数介绍

      * 短选项

    * 结合位置参数和可选参数

    * 进行一些小小的改进

      * 矛盾的选项

    * 后记

* Python 常见问题

  * Python常见问题

    * 一般信息

    * 现实世界中的 Python

    * Upgrading Python

  * 编程常见问题

    * 一般问题

    * 核心语言

    * 数字和字符串

    * 序列（元组/列表）

    * Dictionaries

    * 对象

    * 模块

  * 设计和历史常见问题

    * 为什么Python使用缩进来分组语句？

    * 为什么简单的算术运算得到奇怪的结果？

    * Why are floating point calculations so inaccurate?

    * 为什么Python字符串是不可变的？

    * 为什么必须在方法定义和调用中显式使用“self”？

    * 为什么不能在表达式中赋值？

    * 为什么Python对某些功能（例如list.index()）使用方法来实现，而其他
      功能（例如len(List)）使用函数实现？

    * 为什么 join()是一个字符串方法而不是列表或元组方法？

    * 异常有多快？

    * 为什么Python中没有switch或case语句？

    * 难道不能在解释器中模拟线程，而非得依赖特定于操作系统的线程实现吗
      ？

    * 为什么lambda表达式不能包含语句？

    * 可以将Python编译为机器代码，C或其他语言吗？

    * Python如何管理内存？

    * Why isn’t all memory freed when Python exits?

    * 为什么有单独的元组和列表数据类型？

    * 列表是如何在CPython中实现的？

    * 字典是如何在CPython中实现的？

    * 为什么字典key必须是不可变的？

    * 为什么 list.sort() 没有返回排序列表？

    * 如何在Python中指定和实施接口规范？

    * 为什么没有goto？

    * 为什么原始字符串（r-strings）不能以反斜杠结尾？

    * 为什么Python没有属性赋值的“with”语句？

    * 为什么 if/while/def/class语句需要冒号？

    * 为什么Python在列表和元组的末尾允许使用逗号？

  * 代码库和插件 FAQ

    * 通用的代码库问题

    * 通用任务

    * 线程相关

    * 输入输出

    * 网络 / Internet 编程

    * 数据库

    * 数学和数字

  * 扩展/嵌入常见问题

    * 可以使用C语言中创建自己的函数吗？

    * 可以使用C++语言中创建自己的函数吗？

    * C很难写，有没有其他选择？

    * 如何在 C 中执行任意 Python 语句？

    * 如何在 C 中对任意 Python 表达式求值？

    * 如何从Python对象中提取C的值？

    * 如何使用Py_BuildValue()创建任意长度的元组？

    * 如何从C调用对象的方法？

    * 如何捕获PyErr_Print()（或打印到stdout / stderr的任何内容）的输出
      ？

    * 如何从C访问用Python编写的模块？

    * 如何在 Python 中对接 C ++ 对象？

    * 我使用Setup文件添加了一个模块，为什么make失败了？

    * 如何调试扩展？

    * 我想在Linux系统上编译一个Python模块，但是缺少一些文件。为什么?

    * What does “SystemError: _PyImport_FixupExtension: module
      yourmodule not loaded” mean?

    * 如何区分“输入不完整”和“输入无效”？

    * 如何找到未定义的g++符号__builtin_new或__pure_virtual？

    * 能否创建一个对象类，其中部分方法在C中实现，而其他方法在Python中
      实现（例如通过继承）？

    * When importing module X, why do I get “undefined symbol:
      PyUnicodeUCS2*”?

  * Python在Windows上的常见问题

    * 我怎样在Windows下运行一个Python程序？

    * 我怎么让 Python 脚本可执行？

    * 为什么有时候 Python 程序会启动缓慢？

    * 我怎样使用Python脚本制作可执行文件？

    * "*.pyd" 文件和DLL文件相同吗？

    * 我怎样将Python嵌入一个Windows程序？

    * 如何让编辑器不要在我的 Python 源代码中插入 tab ？

    * 如何在不阻塞的情况下检查按键？

    * How do I emulate os.kill() in Windows?

    * How do I extract the downloaded documentation on Windows?

  * 图形用户界面（GUI）常见问题

    * Python 是否有平台无关的图形界面工具包？

    * 有哪些Python的GUI工具是某个平台专用的？

    * 有关Tkinter的问题

  * “为什么我的电脑上安装了 Python ？”

    * 什么是 Python？

    * 为什么我的电脑上安装了 Python ？

    * 我能删除 Python 吗？

* 术语对照表

* 文档说明

  * Python 文档的贡献者

* Reporting Bugs

  * 文档 Bug

  * 使用 Python 的问题追踪系统

  * 开始为 Python 贡献您的知识

* Copyright

* 历史和许可证

  * 该软件的历史

  * 获取或以其他方式使用 Python 的条款和条件

    * 用于 PYTHON 2.7.17 的 PSF 许可协议

    * 用于 PYTHON 2.0 的 BEOPEN.COM 许可协议

    * 用于 PYTHON 1.6.1 的 CNRI 许可协议

    * 用于 PYTHON 0.9.0 至 1.2 的 CWI 许可协议

  * 被收录软件的许可证与鸣谢

    * Mersenne Twister

    * 套接字

    * Floating point exception control

    * MD5 message digest algorithm

    * 异步套接字服务

    * Cookie 管理

    * 执行追踪

    * UUencode 与 UUdecode 函数

    * XML 远程过程调用

    * test_epoll

    * Select kqueue

    * strtod and dtoa

    * OpenSSL

    * expat

    * libffi

    * zlib
