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.

Python 的 Windows 安裝檔基本上包含整個標準函式庫,且通常也包含許多附加的組件;而在類 Unix 作業系統方面,Python 通常是以一系列的套件被安裝,因此對於某些或全部的可選組件,可能都必須使用該作業系統提供的套件管理工具來安裝。

在標準函式庫之外,還有成千上萬且不斷增加的組件(從個別的程式、模組、套件到完整的應用程式開發框架),可以從 Python 套件索引 (Python Package Index) 中取得。