Python Documentation README


目录

This directory contains the reStructuredText (reST) sources to the Python documentation. You don't need to build them yourself, prebuilt versions are available.

Documentation on authoring Python documentation, including information about both style and markup, is available in the "`Documenting Python <https://devguide.python.org/documenting/>`_" chapter of the developers guide.

Building the docs

The documentation is built with several tools which are not included in this tree but are maintained separately and are available from PyPI.

The easiest way to install these tools is to create a virtual environment and install the tools into there.

Using make

To get started on Unix, you can create a virtual environment and build documentation with the commands:

make venv
make html

The virtual environment in the venv directory will contain all the tools necessary to build the documentation downloaded and installed from PyPI. If you'd like to create the virtual environment in a different location, you can specify it using the VENVDIR variable.

You can also skip creating the virtual environment altogether, in which case the Makefile will look for instances of sphinx-build and blurb installed on your process PATH (configurable with the SPHINXBUILD and BLURB variables).

On Windows, we try to emulate the Makefile as closely as possible with a make.bat file. If you need to specify the Python interpreter to use, set the PYTHON environment variable.

Available make targets are:

Without make

First, install the tool dependencies from PyPI.

Then, from the Doc directory, run :

sphinx-build -b<builder> . build/<builder>

where <builder> is one of html, text, latex, or htmlhelp (for explanations see the make targets above).

Deprecation header

You can define the outdated variable in html_context to show a red banner on each page redirecting to the "latest" version.

Contributing

Bugs in the content should be reported to the Python bug tracker.

Bugs in the toolset should be reported to the tools themselves.

To help with the documentation, or report any problems, please leave a message on discuss.python.org.


版本号 #2
由 壳壳虫 创建于 2026-10-31 16:47:55 UTC
由 壳壳虫 更新于 2026-10-31 16:47:58 UTC