The Python Standard LibraryPython标准库

While The Python Language Reference describes the exact syntax and semantics of the Python language, this library reference manual describes the standard library that is distributed with Python. 虽然Python语言参考描述了Python语言的确切语法和语义,但本库参考手册描述了随Python发布的标准库。It also describes some of the optional components that are commonly included in Python distributions.它还描述了Python发行版中通常包含的一些可选组件。

Python’s standard library is very extensive, offering a wide range of facilities as indicated by the long table of contents listed below. Python的标准库非常广泛,提供了各种各样的功能,如下面列出的长目录所示。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. 该库包含内置模块(用C编写),这些模块提供对系统功能的访问,例如Python程序员无法访问的文件I/O,以及用Python编写的模块,这些模块为日常编程中出现的许多问题提供标准化解决方案。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.其中一些模块被明确设计为通过将平台细节抽象为平台无关的API来鼓励和增强Python程序的可移植性。

The Python installers for the Windows platform usually include the entire standard library and often also include many additional components. Windows平台的Python安装程序通常包括整个标准库,并且通常还包括许多附加组件。For Unix-like operating systems Python is normally provided as a collection of packages, so it may be necessary to use the packaging tools provided with the operating system to obtain some or all of the optional components.对于类Unix的操作系统,Python通常作为一组包提供,因此可能需要使用操作系统提供的打包工具来获取部分或全部可选组件。

In addition to the standard library, there is a growing collection of several thousand components (from individual programs and modules to packages and entire application development frameworks), available from the Python Package Index.除了标准库之外,还有越来越多的组件(从单个程序和模块到软件包和整个应用程序开发框架),可从Python软件包索引获得。