Python 文档目录¶
- Python的新变化
- Python 3.13 有什么新变化
- 摘要 -- 发布重点
- 新的特性
- 其他语言特性修改
- 新增模块
- 改进的模块
- argparse
- array
- ast
- asyncio
- base64
- compileall
- concurrent.futures
- configparser
- copy
- ctypes
- dbm
- dis
- doctest
- fractions
- glob
- importlib
- io
- ipaddress
- itertools
- marshal
- math
- mimetypes
- mmap
- multiprocessing
- os
- os.path
- pathlib
- pdb
- queue
- random
- re
- shutil
- site
- sqlite3
- ssl
- statistics
- subprocess
- sys
- tempfile
- time
- tkinter
- 回溯
- types
- typing
- unicodedata
- venv
- warnings
- xml
- zipimport
- 性能优化
- 被移除的模块与 API
- 新的弃用
- CPython 字节码的变化
- C API 的变化
- 构建变化
- Porting to Python 3.13
- 回归测试的变化
- Notable changes in 3.13.1
- Python 3.12 有什么新变化
- Python 3.11 有什么新变化
- Python 3.10 有什么新变化
- 摘要 -- 发布重点
- 新的特性
- 有关类型提示的新增特性
- 其他语言特性修改
- 新增模块
- 改进的模块
- asyncio
- argparse
- array
- asynchat、asyncore 和 smtpd
- base64
- bdb
- bisect
- 编码器
- collections.abc
- contextlib
- curses
- dataclasses
- distutils
- doctest
- encodings
- enum
- fileinput
- faulthandler
- gc
- glob
- hashlib
- hmac
- IDLE 与 idlelib
- importlib.metadata
- inspect
- itertools
- linecache
- os
- os.path
- pathlib
- 平台
- pprint
- py_compile
- pyclbr
- shelve
- statistics
- site
- socket
- ssl
- sqlite3
- sys
- _thread
- threading
- traceback
- types
- typing
- unittest
- urllib.parse
- xml
- zipimport
- 性能优化
- 弃用
- 移除
- 移植到 Python 3.10
- CPython 字节码的改变
- 编译版的变化
- C API 的变化
- 3.10.7 中的重要安全特性
- 3.10.8 中的重要安全特性
- 3.10.12 中的重要变化
- Python 3.9 有什么新变化
- Python 3.8 有什么新变化
- 摘要 -- 发布重点
- 新的特性
- 其他语言特性修改
- 新增模块
- 改进的模块
- ast
- asyncio
- builtins
- collections
- cProfile
- csv
- curses
- ctypes
- datetime
- functools
- gc
- gettext
- gzip
- IDLE 与 idlelib
- inspect
- io
- itertools
- json.tool
- logging
- math
- mmap
- multiprocessing
- os
- os.path
- pathlib
- pickle
- plistlib
- pprint
- py_compile
- shlex
- shutil
- socket
- ssl
- statistics
- sys
- tarfile
- threading
- tokenize
- tkinter
- time
- typing
- unicodedata
- unittest
- venv
- weakref
- xml
- xmlrpc
- 性能优化
- 构建和 C API 的改变
- 弃用
- API 与特性的移除
- 移植到 Python 3.8
- Python 3.8.1 中的重要变化
- Python 3.8.2 中的重要变化
- Python 3.8.3 中的重要变化
- Python 3.8.8 中的重要变化
- Python 3.8.9 中的重要变化
- Python 3.8.10 中的重要变化
- Python 3.8.10 中的重要变化
- Python 3.8.12 中的重要变化
- 3.8.14 中的重要安全特性
- 3.8.17 中的重要变化
- Python 3.7 有什么新变化
- 摘要 - 发布重点
- 新的特性
- 其他语言特性修改
- 新增模块
- 改进的模块
- argparse
- asyncio
- binascii
- calendar
- collections
- compileall
- concurrent.futures
- contextlib
- cProfile
- crypt
- datetime
- dbm
- decimal
- dis
- distutils
- enum
- functools
- gc
- hmac
- http.client
- http.server
- idlelib 与 IDLE
- importlib
- io
- ipaddress
- itertools
- locale
- logging
- math
- mimetypes
- msilib
- multiprocessing
- os
- pathlib
- pdb
- py_compile
- pydoc
- queue
- re
- signal
- socket
- socketserver
- sqlite3
- ssl
- string
- subprocess
- sys
- time
- tkinter
- tracemalloc
- types
- unicodedata
- unittest
- unittest.mock
- urllib.parse
- uu
- uuid
- warnings
- xml
- xml.etree
- xmlrpc.server
- zipapp
- zipfile
- C API 的改变
- 构建的改变
- 性能优化
- 其他 CPython 实现的改变
- 已弃用的 Python 行为
- 已弃用的 Python 模块、函数和方法
- 已弃用的 C API 函数和类型
- 平台支持的移除
- API 与特性的移除
- 移除的模块
- Windows 专属的改变
- 移植到 Python 3.7
- Python 3.7.1 中的重要变化
- Python 3.7.2 中的重要变化
- Python 3.7.6 中的重要变化
- Python 3.7.10 中的重要变化
- Python 3.7.11 中的重要变化
- 3.7.14 中的重要安全特性
- Python 3.6 有什么新变化
- 摘要 -- 发布重点
- 新的特性
- PEP 498: 格式化字符串字面值
- PEP 526: 变量标注的语法
- PEP 515: 数字字面值中的下划线。
- PEP 525: 异步生成器
- PEP 530: 异步推导式
- PEP 487: 更简单的自定义类创建
- PEP 487: 描述器协议的增强
- PEP 519: 添加文件系统路径协议
- PEP 495: 消除本地时间的歧义
- PEP 529: 将 Windows 文件系统编码格式更改为 UTF-8
- PEP 528: 将 Windows 控制台编码格式更改为 UTF-8
- PEP 520: 保留类属性定义顺序
- PEP 468: 保留关键字参数顺序
- 新的 dict 实现
- PEP 523: 向 CPython 添加帧求值 API
- PYTHONMALLOC 环境变量
- DTrace 和 SystemTap 探测支持
- 其他语言特性修改
- 新增模块
- 改进的模块
- array
- ast
- asyncio
- binascii
- cmath
- collections
- concurrent.futures
- contextlib
- datetime
- decimal
- distutils
- encodings
- enum
- faulthandler
- fileinput
- hashlib
- http.client
- idlelib 与 IDLE
- importlib
- inspect
- json
- logging
- math
- multiprocessing
- os
- pathlib
- pdb
- pickle
- pickletools
- pydoc
- random
- re
- readline
- rlcompleter
- shlex
- site
- sqlite3
- socket
- socketserver
- ssl
- statistics
- struct
- subprocess
- sys
- telnetlib
- time
- timeit
- tkinter
- 回溯
- tracemalloc
- typing
- unicodedata
- unittest.mock
- urllib.request
- urllib.robotparser
- venv
- warnings
- winreg
- winsound
- xmlrpc.client
- zipfile
- zlib
- 性能优化
- 构建和 C API 的改变
- 其他改进
- 弃用
- 移除
- 移植到Python 3.6
- Python 3.6.2 中的重要变化
- Python 3.6.4 中的重要变化
- Python 3.6.5 中的重要变化
- Python 3.6.7 中的重要变化
- Python 3.6.10 中的重要变化
- Python 3.6.13 中的重要变化
- Python 3.6.14 中的重要变化
- Python 3.5 有什么新变化
- 摘要 -- 发布重点
- 新的特性
- PEP 492 - 使用 async 和 await 语法实现协程
- PEP 465 - 用于矩阵乘法的专用中缀运算符
- PEP 448 - 进一步的解包标准化
- PEP 461 - 针对 bytes 和 bytearray 的百分号格式化支持
- PEP 484 —— 类型提示
- PEP 471 - os.scandir() 函数 -- 一个更好且更快的目录迭代器
- PEP 475: 重试返回 EINTR 失败码的系统调用
- PEP 479:更改生成器内部的 StopIteration 处理
- PEP 485:用于测试近似相等的函数
- PEP 486:让 Python 启动器识别虚拟环境
- PEP 488:去除 PYO 文件
- PEP 489:多阶段扩展模块初始化
- 其他语言特性修改
- 新增模块
- 改进的模块
- argparse
- asyncio
- bz2
- cgi
- cmath
- code
- collections
- collections.abc
- compileall
- concurrent.futures
- configparser
- contextlib
- csv
- curses
- dbm
- difflib
- distutils
- doctest
- enum
- faulthandler
- functools
- glob
- gzip
- heapq
- http
- http.client
- idlelib 与 IDLE
- imaplib
- imghdr
- importlib
- inspect
- io
- ipaddress
- json
- linecache
- locale
- logging
- lzma
- math
- multiprocessing
- operator
- os
- pathlib
- pickle
- poplib
- re
- readline
- selectors
- shutil
- signal
- smtpd
- smtplib
- sndhdr
- socket
- ssl
- sqlite3
- subprocess
- sys
- sysconfig
- tarfile
- threading
- time
- timeit
- tkinter
- 回溯
- types
- unicodedata
- unittest
- unittest.mock
- urllib
- wsgiref
- xmlrpc
- xml.sax
- zipfile
- 其他模块级更改
- 性能优化
- 构建和 C API 的改变
- 弃用
- 移除
- 移植到Python 3.5
- Python 3.5.4 的显著变化
- Python 3.4 有什么新变化
- 摘要 - 发布重点
- 新的特性
- 新增模块
- 改进的模块
- abc
- aifc
- argparse
- audioop
- base64
- collections
- colorsys
- contextlib
- dbm
- dis
- doctest
- filecmp
- functools
- gc
- glob
- hashlib
- hmac
- html
- http
- idlelib 与 IDLE
- importlib
- inspect
- ipaddress
- logging
- marshal
- mmap
- multiprocessing
- operator
- os
- pdb
- pickle
- plistlib
- poplib
- pprint
- pty
- pydoc
- re
- resource
- select
- shelve
- shutil
- smtpd
- smtplib
- socket
- sqlite3
- ssl
- stat
- struct
- subprocess
- sunau
- sys
- tarfile
- textwrap
- threading
- 回溯
- types
- urllib
- unittest
- venv
- wave
- weakref
- xml.etree
- zipfile
- CPython 实现的变化
- 弃用
- 移除
- 移植到 Python 3.4
- 3.4.3 的变化
- Python 3.3 有什么新变化
- 摘要 -- 发布重点
- PEP 405: 虚拟环境
- PEP 420: 隐式命名空间包
- PEP 3118: 新的内存视图实现和缓冲协议文档
- PEP 393: 灵活的字符串表示
- PEP 397: 适用于Windows的Python启动器
- PEP 3151: 重写 OS 和 IO 异常的层次结构
- PEP 380: 委托给子生成器的语法
- PEP 409: 清除异常上下文
- PEP 414: 显式的Unicode文本
- PEP 3155: 类和函数的限定名称
- PEP 412: Key-Sharing Dictionary
- PEP 362: 函数签名对象
- PEP 421: 添加 sys.implementation
- 使用 importlib 作为导入的实现
- 其他语言特性修改
- A Finer-Grained Import Lock
- Builtin functions and types
- 新增模块
- 改进的模块
- abc
- array
- base64
- binascii
- bz2
- 编码器
- collections
- contextlib
- crypt
- curses
- datetime
- decimal
- ftplib
- functools
- gc
- hmac
- http
- html
- imaplib
- inspect
- io
- itertools
- logging
- math
- mmap
- multiprocessing
- nntplib
- os
- pdb
- pickle
- pydoc
- re
- sched
- select
- shlex
- shutil
- signal
- smtpd
- smtplib
- socket
- socketserver
- sqlite3
- ssl
- stat
- struct
- subprocess
- sys
- tarfile
- tempfile
- textwrap
- threading
- time
- types
- unittest
- urllib
- webbrowser
- xml.etree.ElementTree
- zlib
- 性能优化
- 构建和 C API 的改变
- 弃用
- 移植到 Python 3.3
- Python 3.2 有什么新变化
- PEP 384: 定义稳定的ABI
- PEP 389: Argparse 命令行解析模块
- PEP 391: 基于字典的日志配置
- PEP 3148:
concurrent.futures
模块 - PEP 3147: PYC 仓库目录
- PEP 3149: 带有 ABI 版本标签的 .so 文件
- PEP 3333: Python Web服务器网关接口v1.0.1
- 其他语言特性修改
- 新增,改进和弃用的模块
- elementtree
- functools
- itertools
- collections
- threading
- datetime 和 time
- math
- abc
- io
- reprlib
- logging
- csv
- contextlib
- decimal and fractions
- ftp
- popen
- select
- gzip 和 zipfile
- tarfile
- hashlib
- ast
- os
- shutil
- sqlite3
- html
- socket
- ssl
- nntp
- certificates
- imaplib
- http.client
- unittest
- random
- poplib
- asyncore
- tempfile
- inspect
- pydoc
- dis
- dbm
- ctypes
- site
- sysconfig
- pdb
- configparser
- urllib.parse
- mailbox
- turtledemo
- 多线程
- 性能优化
- Unicode
- 编解码器
- 文档
- IDLE
- 代码库
- 构建和 C API 的改变
- 移植到 Python 3.2
- Python 3.1 有什么新变化
- Python 3.0 有什么新变化
- Python 2.7 有什么新变化
- Python 2.x的未来
- 对于弃用警告处理方式的改变
- Python 3.1 特性
- PEP 372:将有序字典 添加到收藏集
- PEP 378: 千位分隔符的格式说明符
- PEP 389:用于解析命令行的 argparse 模块
- PEP 391: 基于字典的日志配置
- PEP 3106: 字典视图
- PEP 3137: memoryview 对象
- 其他语言特性修改
- 新增和改进的模块
- 构建和 C API 的改变
- 其他的改变和修正
- 移植到 Python 2.7
- New Features Added to Python 2.7 Maintenance Releases
- 致谢
- Python 2.6 有什么新变化
- Python 3.0
- 开发过程的变化
- PEP 343: "with" 语句
- 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: 数字的类型层级结构
- 其他语言特性修改
- 新增和改进的模块
- 弃用和移除
- 构建和 C API 的改变
- 移植到Python 2.6
- 致谢
- Python 2.5 有什么新变化
- Python 2.4 有什么新变化
- Python 2.3 有什么新变化
- PEP 218: 标准集合数据类型
- PEP 255: 简单的生成器
- PEP 263: 源代码的字符编码格式
- PEP 273: 从ZIP压缩包导入模块
- PEP 277: 针对 Windows NT 的 Unicode 文件名支持
- PEP 278: 通用换行支持
- PEP 279: enumerate()
- PEP 282: logging 包
- PEP 285: 布尔类型
- PEP 293: 编解码器错误处理回调
- PEP 301: Distutils的软件包索引和元数据
- PEP 302: 新导入钩子
- PEP 305: 逗号分隔文件
- PEP 307:对 pickle 的改进
- 扩展切片
- 其他语言特性修改
- 新增,改进和弃用的模块
- Pymalloc: A Specialized Object Allocator
- 构建和 C API 的改变
- 其他的改变和修正
- 移植到 Python 2.3
- 致谢
- Python 2.2 有什么新变化
- Python 2.1 有什么新变化
- Python 2.0 有什么新变化
- 更新日志
- Python next
- Python 3.13.1 final
- Python 3.13.0 final
- Python 3.13.0 release candidate 3
- Python 3.13.0 release candidate 2
- Python 3.13.0 release candidate 1
- Python 3.13.0 beta 4
- Python 3.13.0 beta 3
- Python 3.13.0 beta 2
- Python 3.13.0 beta 1
- Python 3.13.0 alpha 6
- Python 3.13.0 alpha 5
- Python 3.13.0 alpha 4
- Python 3.13.0 alpha 3
- Python 3.13.0 alpha 2
- Python 3.13.0 alpha 1
- Python 3.12.0 beta 1
- Python 3.12.0 alpha 7
- Python 3.12.0 alpha 6
- Python 3.12.0 alpha 5
- Python 3.12.0 alpha 4
- Python 3.12.0 alpha 3
- Python 3.12.0 alpha 2
- Python 3.12.0 alpha 1
- Python 3.11.0 beta 1
- Python 3.11.0 alpha 7
- Python 3.11.0 alpha 6
- Python 3.11.0 alpha 5
- Python 3.11.0 alpha 4
- Python 3.11.0 alpha 3
- Python 3.11.0 alpha 2
- Python 3.11.0 alpha 1
- Python 3.10.0 beta 1
- Python 3.10.0 alpha 7
- Python 3.10.0 alpha 6
- Python 3.10.0 alpha 5
- Python 3.10.0 alpha 4
- Python 3.10.0 alpha 3
- Python 3.10.0 alpha 2
- Python 3.10.0 alpha 1
- Python 3.9.0 beta 1
- Python 3.9.0 alpha 6
- Python 3.9.0 alpha 5
- Python 3.9.0 alpha 4
- Python 3.9.0 alpha 3
- Python 3.9.0 alpha 2
- Python 3.9.0 alpha 1
- Python 3.8.0 beta 1
- Python 3.8.0 alpha 4
- Python 3.8.0 alpha 3
- Python 3.8.0 alpha 2
- Python 3.8.0 alpha 1
- Python 3.7.0 final
- Python 3.7.0 release candidate 1
- Python 3.7.0 beta 5
- Python 3.7.0 beta 4
- Python 3.7.0 beta 3
- Python 3.7.0 beta 2
- Python 3.7.0 beta 1
- Python 3.7.0 alpha 4
- Python 3.7.0 alpha 3
- Python 3.7.0 alpha 2
- Python 3.7.0 alpha 1
- Python 3.6.6 final
- Python 3.6.6 release candidate 1
- Python 3.6.5 final
- Python 3.6.5 release candidate 1
- Python 3.6.4 final
- Python 3.6.4 release candidate 1
- Python 3.6.3 final
- Python 3.6.3 release candidate 1
- Python 3.6.2 final
- Python 3.6.2 release candidate 2
- Python 3.6.2 release candidate 1
- Python 3.6.1 final
- Python 3.6.1 release candidate 1
- Python 3.6.0 final
- Python 3.6.0 release candidate 2
- Python 3.6.0 release candidate 1
- Python 3.6.0 beta 4
- Python 3.6.0 beta 3
- Python 3.6.0 beta 2
- Python 3.6.0 beta 1
- Python 3.6.0 alpha 4
- Python 3.6.0 alpha 3
- Python 3.6.0 alpha 2
- Python 3.6.0 alpha 1
- Python 3.5.5 final
- Python 3.5.5 release candidate 1
- Python 3.5.4 final
- Python 3.5.4 release candidate 1
- Python 3.5.3 final
- Python 3.5.3 release candidate 1
- Python 3.5.2 final
- Python 3.5.2 release candidate 1
- Python 3.5.1 final
- Python 3.5.1 release candidate 1
- Python 3.5.0 final
- Python 3.5.0 release candidate 4
- Python 3.5.0 release candidate 3
- Python 3.5.0 release candidate 2
- Python 3.5.0 release candidate 1
- Python 3.5.0 beta 4
- Python 3.5.0 beta 3
- Python 3.5.0 beta 2
- Python 3.5.0 beta 1
- Python 3.5.0 alpha 4
- Python 3.5.0 alpha 3
- Python 3.5.0 alpha 2
- Python 3.5.0 alpha 1
- Python 3.13 有什么新变化
- Python 教程
- 1. 课前甜点
- 2. 使用 Python 的解释器
- 3. Python 速览
- 4. 更多控制流工具
- 5. 数据结构
- 6. 模块
- 7. 输入与输出
- 8. 错误和异常
- 9. 类
- 10. 标准库简介
- 11. 标准库简介 —— 第二部分
- 12. 虚拟环境和包
- 13. 接下来?
- 14. 交互式编辑和编辑历史
- 15. 浮点算术:争议和限制
- 16. 附录
- Python安装和使用
- 1. 命令行与环境
- 2. 在类Unix环境下使用Python
- 3. 配置 Python
- 4. 在Windows上使用 Python
- 5. 在 macOS 上使用 Python
- 6. 在Android上使用 Python
- 7. 在 iOS 上使用 Python
- 8. 编辑器和集成开发环境
- Python 语言参考手册
- 1. 概述
- 2. 词法分析
- 3. 数据模型
- 3.1. 对象、值与类型
- 3.2. 标准类型层级结构
- 3.2.1. None
- 3.2.2. NotImplemented
- 3.2.3. Ellipsis
- 3.2.4.
numbers.Number
- 3.2.5. 序列
- 3.2.6. 集合类型
- 3.2.7. 映射
- 3.2.8. 可调用类型
- 3.2.9. 模块
- 3.2.10. 自定义类
- 3.2.11. 类实例
- 3.2.12. I/O 对象 (或称文件对象)
- 3.2.13. 内部类型
- 3.3. 特殊方法名称
- 3.3.1. 基本定制
- 3.3.2. 自定义属性访问
- 3.3.3. 自定义类创建
- 3.3.4. 自定义实例及子类检查
- 3.3.5. 模拟泛型类型
- 3.3.6. 模拟可调用对象
- 3.3.7. 模拟容器类型
- 3.3.8. 模拟数字类型
__add__()
__sub__()
__mul__()
__matmul__()
__truediv__()
__floordiv__()
__mod__()
__divmod__()
__pow__()
__lshift__()
__rshift__()
__and__()
__xor__()
__or__()
__radd__()
__rsub__()
__rmul__()
__rmatmul__()
__rtruediv__()
__rfloordiv__()
__rmod__()
__rdivmod__()
__rpow__()
__rlshift__()
__rrshift__()
__rand__()
__rxor__()
__ror__()
__iadd__()
__isub__()
__imul__()
__imatmul__()
__itruediv__()
__ifloordiv__()
__imod__()
__ipow__()
__ilshift__()
__irshift__()
__iand__()
__ixor__()
__ior__()
__neg__()
__pos__()
__abs__()
__invert__()
__complex__()
__int__()
__float__()
__index__()
__round__()
__trunc__()
__floor__()
__ceil__()
- 3.3.9. with 语句上下文管理器
- 3.3.10. 定制类模式匹配中的位置参数
- 3.3.11. 模拟缓冲区类型
- 3.3.12. 特殊方法查找
- 3.4. 协程
- 4. 执行模型
- 5. 导入系统
- 6. 表达式
- 7. 简单语句
- 8. 复合语句
- 9. 顶级组件
- 10. 完整的语法规范
- Python 标准库
- 概述
- 内置函数
abs()
aiter()
all()
anext()
any()
ascii()
bin()
bool
breakpoint()
callable()
chr()
classmethod()
compile()
complex
delattr()
dir()
divmod()
enumerate()
eval()
exec()
filter()
float
format()
getattr()
globals()
hasattr()
hash()
help()
hex()
id()
input()
int
isinstance()
issubclass()
iter()
len()
locals()
map()
max()
min()
next()
object
oct()
open()
ord()
pow()
print()
property
repr()
reversed()
round()
setattr()
slice
sorted()
staticmethod()
sum()
super
type
vars()
zip()
__import__()
- 内置常量
- 内置类型
- 逻辑值检测
- 布尔运算 ---
and
,or
,not
- 比较运算
- 数字类型 ---
int
,float
,complex
- 布尔类型 -
bool
- 迭代器类型
- 序列类型 ---
list
,tuple
,range
- 文本序列类型 ---
str
str
- 字符串的方法
capitalize()
casefold()
center()
count()
encode()
endswith()
expandtabs()
find()
format()
format_map()
index()
isalnum()
isalpha()
isascii()
isdecimal()
isdigit()
isidentifier()
islower()
isnumeric()
isprintable()
isspace()
istitle()
isupper()
join()
ljust()
lower()
lstrip()
maketrans()
partition()
removeprefix()
removesuffix()
replace()
rfind()
rindex()
rjust()
rpartition()
rsplit()
rstrip()
split()
splitlines()
startswith()
strip()
swapcase()
title()
translate()
upper()
zfill()
printf
风格的字符串格式化
- 二进制序列类型 ---
bytes
,bytearray
,memoryview
- bytes 对象
- bytearray 对象
- bytes 和 bytearray 操作
count()
count()
removeprefix()
removeprefix()
removesuffix()
removesuffix()
decode()
decode()
endswith()
endswith()
find()
find()
index()
index()
join()
join()
maketrans()
maketrans()
partition()
partition()
replace()
replace()
rfind()
rfind()
rindex()
rindex()
rpartition()
rpartition()
startswith()
startswith()
translate()
translate()
center()
center()
ljust()
ljust()
lstrip()
lstrip()
rjust()
rjust()
rsplit()
rsplit()
rstrip()
rstrip()
split()
split()
strip()
strip()
capitalize()
capitalize()
expandtabs()
expandtabs()
isalnum()
isalnum()
isalpha()
isalpha()
isascii()
isascii()
isdigit()
isdigit()
islower()
islower()
isspace()
isspace()
istitle()
istitle()
isupper()
isupper()
lower()
lower()
splitlines()
splitlines()
swapcase()
swapcase()
title()
title()
upper()
upper()
zfill()
zfill()
printf
风格的字节串格式化- 内存视图
- 集合类型 ---
set
,frozenset
- 映射类型 ---
dict
- 上下文管理器类型
- 类型注解的类型 --- Generic Alias 、 Union
- 其他内置类型
- 特殊属性
- 整数字符串转换长度限制
- 内置异常
- 异常上下文
- 从内置异常继承
- 基类
- 具体异常
AssertionError
AttributeError
EOFError
FloatingPointError
GeneratorExit
ImportError
ModuleNotFoundError
IndexError
KeyError
KeyboardInterrupt
MemoryError
NameError
NotImplementedError
OSError
OverflowError
PythonFinalizationError
RecursionError
ReferenceError
RuntimeError
StopIteration
StopAsyncIteration
SyntaxError
IndentationError
TabError
SystemError
SystemExit
TypeError
UnboundLocalError
UnicodeError
UnicodeEncodeError
UnicodeDecodeError
UnicodeTranslateError
ValueError
ZeroDivisionError
EnvironmentError
IOError
WindowsError
- OS 异常
- 警告
- 异常组
- 异常层次结构
- 文本处理服务
string
--- 常见的字符串操作re
--- 正则表达式操作difflib
--- 计算差异的辅助工具textwrap
--- 文本自动换行与填充unicodedata
--- Unicode 数据库stringprep
--- 因特网字符串预处理readline
--- GNU readline 接口rlcompleter
--- 用于 GNU readline 的补全函数
- 二进制数据服务
struct
--- 将字节串解读为打包的二进制数据codecs
--- 编解码器注册和相关基类encode()
decode()
lookup()
CodecInfo
getencoder()
getdecoder()
getincrementalencoder()
getincrementaldecoder()
getreader()
getwriter()
register()
unregister()
open()
EncodedFile()
iterencode()
iterdecode()
BOM
BOM_BE
BOM_LE
BOM_UTF8
BOM_UTF16
BOM_UTF16_BE
BOM_UTF16_LE
BOM_UTF32
BOM_UTF32_BE
BOM_UTF32_LE
- 编解码器基类
- 编码格式与 Unicode
- 标准编码
- Python 专属的编码格式
encodings.idna
--- 应用程序中的国际化域名encodings.mbcs
--- Windows ANSI代码页encodings.utf_8_sig
--- 带BOM签名的UTF-8编解码器
- 数据类型
datetime
--- 基本日期和时间类型- 感知型对象和简单型对象
- 常量
- 有效的类型
timedelta
类对象date
对象datetime
对象datetime
today()
now()
utcnow()
fromtimestamp()
utcfromtimestamp()
fromordinal()
combine()
fromisoformat()
fromisocalendar()
strptime()
min
max
resolution
year
month
day
hour
minute
second
microsecond
tzinfo
fold
date()
time()
timetz()
replace()
astimezone()
utcoffset()
dst()
tzname()
timetuple()
utctimetuple()
toordinal()
timestamp()
weekday()
isoweekday()
isocalendar()
isoformat()
__str__()
ctime()
strftime()
__format__()
- 用法示例:
datetime
time
对象tzinfo
对象timezone
对象strftime()
和strptime()
的行为
zoneinfo
--- IANA 时区支持calendar
--- 通用日历相关函数Calendar
TextCalendar
HTMLCalendar
LocaleTextCalendar
LocaleHTMLCalendar
setfirstweekday()
firstweekday()
isleap()
leapdays()
weekday()
weekheader()
monthrange()
monthcalendar()
prmonth()
month()
prcal()
calendar()
timegm()
day_name
day_abbr
MONDAY
TUESDAY
WEDNESDAY
THURSDAY
FRIDAY
SATURDAY
SUNDAY
Day
month_name
month_abbr
JANUARY
FEBRUARY
MARCH
APRIL
MAY
JUNE
JULY
AUGUST
SEPTEMBER
OCTOBER
NOVEMBER
DECEMBER
Month
IllegalMonthError
IllegalWeekdayError
- 命令行用法
collections
--- 容器数据类型collections.abc
--- 容器的抽象基类heapq
--- 堆队列算法bisect
--- 数组二分算法array
--- 高效的数字值数组weakref
--- 弱引用types
--- 动态类型创建和内置类型名称- 动态类型创建
- 标准解释器类型
NoneType
FunctionType
LambdaType
GeneratorType
CoroutineType
AsyncGeneratorType
CodeType
CellType
MethodType
BuiltinFunctionType
BuiltinMethodType
WrapperDescriptorType
MethodWrapperType
NotImplementedType
MethodDescriptorType
ClassMethodDescriptorType
ModuleType
EllipsisType
GenericAlias
UnionType
TracebackType
FrameType
GetSetDescriptorType
MemberDescriptorType
MappingProxyType
CapsuleType
- 附加工具类和函数
- 协程工具函数
copy
--- 浅层及深层拷贝操作pprint
--- 数据美化输出reprlib
--- 替代性repr()
实现enum
--- 对枚举的支持graphlib
--- 操作类似图的结构的功能
- 数字和数学模块
numbers
--- 数字抽象基类math
--- 数学函数cmath
--- 针对复数的数学函数decimal
--- 十进制定点和浮点算术- 快速入门教程
- Decimal 对象
Decimal
adjusted()
as_integer_ratio()
as_tuple()
canonical()
compare()
compare_signal()
compare_total()
compare_total_mag()
conjugate()
copy_abs()
copy_negate()
copy_sign()
exp()
from_float()
fma()
is_canonical()
is_finite()
is_infinite()
is_nan()
is_normal()
is_qnan()
is_signed()
is_snan()
is_subnormal()
is_zero()
ln()
log10()
logb()
logical_and()
logical_invert()
logical_or()
logical_xor()
max()
max_mag()
min()
min_mag()
next_minus()
next_plus()
next_toward()
normalize()
number_class()
quantize()
radix()
remainder_near()
rotate()
same_quantum()
scaleb()
shift()
sqrt()
to_eng_string()
to_integral()
to_integral_exact()
to_integral_value()
- 逻辑操作数
- 上下文对象
getcontext()
setcontext()
localcontext()
BasicContext
ExtendedContext
DefaultContext
Context
clear_flags()
clear_traps()
copy()
copy_decimal()
create_decimal()
create_decimal_from_float()
Etiny()
Etop()
abs()
add()
canonical()
compare()
compare_signal()
compare_total()
compare_total_mag()
copy_abs()
copy_negate()
copy_sign()
divide()
divide_int()
divmod()
exp()
fma()
is_canonical()
is_finite()
is_infinite()
is_nan()
is_normal()
is_qnan()
is_signed()
is_snan()
is_subnormal()
is_zero()
ln()
log10()
logb()
logical_and()
logical_invert()
logical_or()
logical_xor()
max()
max_mag()
min()
min_mag()
minus()
multiply()
next_minus()
next_plus()
next_toward()
normalize()
number_class()
plus()
power()
quantize()
radix()
remainder()
remainder_near()
rotate()
same_quantum()
scaleb()
shift()
sqrt()
subtract()
to_eng_string()
to_integral_exact()
to_sci_string()
- 常量
- 舍入模式
- 信号
- 浮点数说明
- 使用线程
- 例程
- Decimal 常见问题
fractions
--- 有理数random
--- 生成伪随机数statistics
--- 数字统计函数
- 函数式编程模块
itertools
--- 为高效循环创建迭代器的函数functools
—— 高阶函数,以及可调用对象上的操作operator
--- 标准运算符对应函数lt()
le()
eq()
ne()
ge()
gt()
__lt__()
__le__()
__eq__()
__ne__()
__ge__()
__gt__()
not_()
__not__()
truth()
is_()
is_not()
abs()
__abs__()
add()
__add__()
and_()
__and__()
floordiv()
__floordiv__()
index()
__index__()
inv()
invert()
__inv__()
__invert__()
lshift()
__lshift__()
mod()
__mod__()
mul()
__mul__()
matmul()
__matmul__()
neg()
__neg__()
or_()
__or__()
pos()
__pos__()
pow()
__pow__()
rshift()
__rshift__()
sub()
__sub__()
truediv()
__truediv__()
xor()
__xor__()
concat()
__concat__()
contains()
__contains__()
countOf()
delitem()
__delitem__()
getitem()
__getitem__()
indexOf()
setitem()
__setitem__()
length_hint()
call()
__call__()
attrgetter()
itemgetter()
methodcaller()
- 将运算符映射到函数
- 原地运算符
- 文件和目录访问
pathlib
--- 面向对象的文件系统路径os.path
--- 常用的路径操作abspath()
basename()
commonpath()
commonprefix()
dirname()
exists()
lexists()
expanduser()
expandvars()
getatime()
getmtime()
getctime()
getsize()
isabs()
isfile()
isdir()
isjunction()
islink()
ismount()
isdevdrive()
isreserved()
join()
normcase()
normpath()
realpath()
relpath()
samefile()
sameopenfile()
samestat()
split()
splitdrive()
splitroot()
splitext()
supports_unicode_filenames
fileinput
--- 迭代来自多个输入流的行stat
--- 解释stat()
的结果S_ISDIR()
S_ISCHR()
S_ISBLK()
S_ISREG()
S_ISFIFO()
S_ISLNK()
S_ISSOCK()
S_ISDOOR()
S_ISPORT()
S_ISWHT()
S_IMODE()
S_IFMT()
filemode()
ST_MODE
ST_INO
ST_DEV
ST_NLINK
ST_UID
ST_GID
ST_SIZE
ST_ATIME
ST_MTIME
ST_CTIME
S_IFSOCK
S_IFLNK
S_IFREG
S_IFBLK
S_IFDIR
S_IFCHR
S_IFIFO
S_IFDOOR
S_IFPORT
S_IFWHT
S_ISUID
S_ISGID
S_ISVTX
S_IRWXU
S_IRUSR
S_IWUSR
S_IXUSR
S_IRWXG
S_IRGRP
S_IWGRP
S_IXGRP
S_IRWXO
S_IROTH
S_IWOTH
S_IXOTH
S_ENFMT
S_IREAD
S_IWRITE
S_IEXEC
UF_SETTABLE
UF_NODUMP
UF_IMMUTABLE
UF_APPEND
UF_OPAQUE
UF_NOUNLINK
UF_COMPRESSED
UF_TRACKED
UF_DATAVAULT
UF_HIDDEN
SF_SETTABLE
SF_SUPPORTED
SF_SYNTHETIC
SF_ARCHIVED
SF_IMMUTABLE
SF_APPEND
SF_RESTRICTED
SF_NOUNLINK
SF_SNAPSHOT
SF_FIRMLINK
SF_DATALESS
FILE_ATTRIBUTE_ARCHIVE
FILE_ATTRIBUTE_COMPRESSED
FILE_ATTRIBUTE_DEVICE
FILE_ATTRIBUTE_DIRECTORY
FILE_ATTRIBUTE_ENCRYPTED
FILE_ATTRIBUTE_HIDDEN
FILE_ATTRIBUTE_INTEGRITY_STREAM
FILE_ATTRIBUTE_NORMAL
FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
FILE_ATTRIBUTE_NO_SCRUB_DATA
FILE_ATTRIBUTE_OFFLINE
FILE_ATTRIBUTE_READONLY
FILE_ATTRIBUTE_REPARSE_POINT
FILE_ATTRIBUTE_SPARSE_FILE
FILE_ATTRIBUTE_SYSTEM
FILE_ATTRIBUTE_TEMPORARY
FILE_ATTRIBUTE_VIRTUAL
IO_REPARSE_TAG_SYMLINK
IO_REPARSE_TAG_MOUNT_POINT
IO_REPARSE_TAG_APPEXECLINK
filecmp
--- 文件和目录比较tempfile
--- 生成临时文件和目录glob
--- Unix 风格的路径名模式扩展fnmatch
--- Unix 文件名模式匹配linecache
--- 随机访问文本行shutil
--- 高层级文件操作
- 数据持久化
pickle
--- Python 对象序列化copyreg
--- 注册pickle
支持函数shelve
--- Python 对象持久化marshal
--- 内部 Python 对象序列化dbm
--- Unix "数据库" 接口sqlite3
--- SQLite 数据库的 DB-API 2.0 接口- 教程
- 参考
- 模块函数
- 模块常量
LEGACY_TRANSACTION_CONTROL
PARSE_COLNAMES
PARSE_DECLTYPES
SQLITE_OK
SQLITE_DENY
SQLITE_IGNORE
apilevel
paramstyle
sqlite_version
sqlite_version_info
threadsafety
version
version_info
SQLITE_DBCONFIG_DEFENSIVE
SQLITE_DBCONFIG_DQS_DDL
SQLITE_DBCONFIG_DQS_DML
SQLITE_DBCONFIG_ENABLE_FKEY
SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER
SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION
SQLITE_DBCONFIG_ENABLE_QPSG
SQLITE_DBCONFIG_ENABLE_TRIGGER
SQLITE_DBCONFIG_ENABLE_VIEW
SQLITE_DBCONFIG_LEGACY_ALTER_TABLE
SQLITE_DBCONFIG_LEGACY_FILE_FORMAT
SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE
SQLITE_DBCONFIG_RESET_DATABASE
SQLITE_DBCONFIG_TRIGGER_EQP
SQLITE_DBCONFIG_TRUSTED_SCHEMA
SQLITE_DBCONFIG_WRITABLE_SCHEMA
- 连接对象
Connection
cursor()
blobopen()
commit()
rollback()
close()
execute()
executemany()
executescript()
create_function()
create_aggregate()
create_window_function()
create_collation()
interrupt()
set_authorizer()
set_progress_handler()
set_trace_callback()
enable_load_extension()
load_extension()
iterdump()
backup()
getlimit()
setlimit()
getconfig()
setconfig()
serialize()
deserialize()
autocommit
in_transaction
isolation_level
row_factory
text_factory
total_changes
- 游标对象
- Row 对象
- Blob 对象
- PrepareProtocol 对象
- 异常
- SQLite 与 Python 类型
- 默认适配器和转换器(已弃用)
- 命令行接口
- 常用方案指引
- 说明
- 数据压缩和存档
zlib
--- 与 gzip 兼容的压缩gzip
--- 对 gzip 文件的支持bz2
--- 对 bzip2 压缩算法的支持lzma
--- 使用 LZMA 算法进行压缩zipfile
--- 操作 ZIP 归档文件tarfile
--- 读写 tar 归档文件open()
is_tarfile()
TarError
ReadError
CompressionError
StreamError
ExtractError
HeaderError
FilterError
AbsolutePathError
OutsideDestinationError
SpecialFileError
AbsoluteLinkError
LinkOutsideDestinationError
ENCODING
REGTYPE
AREGTYPE
LNKTYPE
SYMTYPE
CHRTYPE
BLKTYPE
DIRTYPE
FIFOTYPE
CONTTYPE
GNUTYPE_LONGNAME
GNUTYPE_LONGLINK
GNUTYPE_SPARSE
USTAR_FORMAT
GNU_FORMAT
PAX_FORMAT
DEFAULT_FORMAT
- TarFile 对象
- TarInfo 对象
- 解压缩过滤器
- 命令行接口
- 例子
- 受支持的 tar 格式
- Unicode 问题
- 文件格式
- 加密服务
- 通用操作系统服务
os
--- 多种操作系统接口error
name
- 文件名,命令行参数,以及环境变量。
- Python UTF-8 模式
- 进程参数
ctermid()
environ
environb
fsencode()
fsdecode()
fspath()
PathLike
getenv()
getenvb()
get_exec_path()
getegid()
geteuid()
getgid()
getgrouplist()
getgroups()
getlogin()
getpgid()
getpgrp()
getpid()
getppid()
getpriority()
PRIO_PROCESS
PRIO_PGRP
PRIO_USER
PRIO_DARWIN_THREAD
PRIO_DARWIN_PROCESS
PRIO_DARWIN_BG
PRIO_DARWIN_NONUI
getresuid()
getresgid()
getuid()
initgroups()
putenv()
setegid()
seteuid()
setgid()
setgroups()
setns()
setpgrp()
setpgid()
setpriority()
setregid()
setresgid()
setresuid()
setreuid()
getsid()
setsid()
setuid()
strerror()
supports_bytes_environ
umask()
uname()
unsetenv()
unshare()
CLONE_FILES
CLONE_FS
CLONE_NEWCGROUP
CLONE_NEWIPC
CLONE_NEWNET
CLONE_NEWNS
CLONE_NEWPID
CLONE_NEWTIME
CLONE_NEWUSER
CLONE_NEWUTS
CLONE_SIGHAND
CLONE_SYSVSEM
CLONE_THREAD
CLONE_VM
- 创建文件对象
- 文件描述符操作
close()
closerange()
copy_file_range()
device_encoding()
dup()
dup2()
fchmod()
fchown()
fdatasync()
fpathconf()
fstat()
fstatvfs()
fsync()
ftruncate()
get_blocking()
grantpt()
isatty()
lockf()
F_LOCK
F_TLOCK
F_ULOCK
F_TEST
login_tty()
lseek()
SEEK_SET
SEEK_CUR
SEEK_END
SEEK_HOLE
SEEK_DATA
open()
O_RDONLY
O_WRONLY
O_RDWR
O_APPEND
O_CREAT
O_EXCL
O_TRUNC
O_DSYNC
O_RSYNC
O_SYNC
O_NDELAY
O_NONBLOCK
O_NOCTTY
O_CLOEXEC
O_BINARY
O_NOINHERIT
O_SHORT_LIVED
O_TEMPORARY
O_RANDOM
O_SEQUENTIAL
O_TEXT
O_EVTONLY
O_FSYNC
O_SYMLINK
O_NOFOLLOW_ANY
O_ASYNC
O_DIRECT
O_DIRECTORY
O_NOFOLLOW
O_NOATIME
O_PATH
O_TMPFILE
O_SHLOCK
O_EXLOCK
openpty()
pipe()
pipe2()
posix_fallocate()
posix_fadvise()
POSIX_FADV_NORMAL
POSIX_FADV_SEQUENTIAL
POSIX_FADV_RANDOM
POSIX_FADV_NOREUSE
POSIX_FADV_WILLNEED
POSIX_FADV_DONTNEED
pread()
posix_openpt()
preadv()
RWF_NOWAIT
RWF_HIPRI
ptsname()
pwrite()
pwritev()
RWF_DSYNC
RWF_SYNC
RWF_APPEND
read()
sendfile()
SF_NODISKIO
SF_MNOWAIT
SF_SYNC
SF_NOCACHE
set_blocking()
splice()
SPLICE_F_MOVE
SPLICE_F_NONBLOCK
SPLICE_F_MORE
readv()
tcgetpgrp()
tcsetpgrp()
ttyname()
unlockpt()
write()
writev()
- 查询终端的尺寸
- 文件描述符的继承
- 文件和目录
access()
F_OK
R_OK
W_OK
X_OK
chdir()
chflags()
chmod()
chown()
chroot()
fchdir()
getcwd()
getcwdb()
lchflags()
lchmod()
lchown()
link()
listdir()
listdrives()
listmounts()
listvolumes()
lstat()
mkdir()
makedirs()
mkfifo()
mknod()
major()
minor()
makedev()
pathconf()
pathconf_names
readlink()
remove()
removedirs()
rename()
renames()
replace()
rmdir()
scandir()
DirEntry
stat()
stat_result
statvfs()
supports_dir_fd
supports_effective_ids
supports_fd
supports_follow_symlinks
symlink()
sync()
truncate()
unlink()
utime()
walk()
fwalk()
memfd_create()
MFD_CLOEXEC
MFD_ALLOW_SEALING
MFD_HUGETLB
MFD_HUGE_SHIFT
MFD_HUGE_MASK
MFD_HUGE_64KB
MFD_HUGE_512KB
MFD_HUGE_1MB
MFD_HUGE_2MB
MFD_HUGE_8MB
MFD_HUGE_16MB
MFD_HUGE_32MB
MFD_HUGE_256MB
MFD_HUGE_512MB
MFD_HUGE_1GB
MFD_HUGE_2GB
MFD_HUGE_16GB
eventfd()
eventfd_read()
eventfd_write()
EFD_CLOEXEC
EFD_NONBLOCK
EFD_SEMAPHORE
- 计时器文件描述符
- Linux 扩展属性
- 进程管理
abort()
add_dll_directory()
execl()
execle()
execlp()
execlpe()
execv()
execve()
execvp()
execvpe()
_exit()
EX_OK
EX_USAGE
EX_DATAERR
EX_NOINPUT
EX_NOUSER
EX_NOHOST
EX_UNAVAILABLE
EX_SOFTWARE
EX_OSERR
EX_OSFILE
EX_CANTCREAT
EX_IOERR
EX_TEMPFAIL
EX_PROTOCOL
EX_NOPERM
EX_CONFIG
EX_NOTFOUND
fork()
forkpty()
kill()
killpg()
nice()
pidfd_open()
plock()
popen()
posix_spawn()
posix_spawnp()
register_at_fork()
spawnl()
spawnle()
spawnlp()
spawnlpe()
spawnv()
spawnve()
spawnvp()
spawnvpe()
P_NOWAIT
P_NOWAITO
P_WAIT
P_DETACH
P_OVERLAY
startfile()
system()
times()
wait()
waitid()
waitpid()
wait3()
wait4()
P_PID
P_PGID
P_ALL
P_PIDFD
WCONTINUED
WEXITED
WSTOPPED
WUNTRACED
WNOHANG
WNOWAIT
CLD_EXITED
CLD_KILLED
CLD_DUMPED
CLD_TRAPPED
CLD_STOPPED
CLD_CONTINUED
waitstatus_to_exitcode()
WCOREDUMP()
WIFCONTINUED()
WIFSTOPPED()
WIFSIGNALED()
WIFEXITED()
WEXITSTATUS()
WSTOPSIG()
WTERMSIG()
- 调度器接口
SCHED_OTHER
SCHED_BATCH
SCHED_IDLE
SCHED_SPORADIC
SCHED_FIFO
SCHED_RR
SCHED_RESET_ON_FORK
sched_param
sched_get_priority_min()
sched_get_priority_max()
sched_setscheduler()
sched_getscheduler()
sched_setparam()
sched_getparam()
sched_rr_get_interval()
sched_yield()
sched_setaffinity()
sched_getaffinity()
- 其他系统信息
- 随机数
io
--- 处理流的核心工具