The Python standard library

This library reference manual describes the standard library distributed with Python. It also describes some of the optional components that are commonly included in Python distributions.

Elsewhere, Python 语言参考手册 describes the exact syntax and semantics of the Python language, and Python built-ins reference describes the built-in functions.

Python's standard library is extensive, offering a wide range of facilities as indicated by the long table of contents listed below. The library contains built-in modules (written in C) that provide access to system functionality such as file I/O that would otherwise be inaccessible to Python programmers, as well as modules written in Python that provide standardized solutions for many problems that occur in everyday programming. Some of these modules are explicitly designed to encourage and enhance the portability of Python programs by abstracting away platform-specifics into platform-neutral APIs.

Windows 版本的 Python 安装程序通常包含整个标准库,往往还包含许多额外组件。对于类 Unix 操作系统,Python 通常会分成一系列的软件包,因此可能需要使用操作系统所提供的包管理工具来获取部分或全部可选组件。

在标准库以外,还存在一个由数十万个组件(从单独的程序和模块到软件包以及完整的应用程序开发框架)组成的活跃合集,可以从 Python 包索引 获取。