← All notes

Python pydoc: generate documentation and online help

Answer: The pydoc module automatically generates documentation from Python objects.

How documentation is shown

Output can appear as console pages, in a web browser, or as saved HTML files.

For modules, classes, functions and methods, the text comes from the docstring of the object.

The built-in help function uses pydoc to generate console documentation.

You can also run pydoc as a script at the operating system command prompt.

How it locates modules

When printing output to the console, pydoc attempts to paginate the output.

If both MANPAGER and PAGER are set, MANPAGER is used.

The synopsis line of a module is the first line of its documentation string.

Core module docs are assumed to reside under the docs.python.org library pages for this interpreter version.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, pydoc — Documentation generator and online help system; CPython, pydoc documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Python Software Foundation, pydoc — Documentation generator and online help system; CPython, pydoc documentation (source). PSF-2.0 (https://docs.python.org/3/license.html). Copyright Python Software Foundation.

Cite this

Permanent ID: iil:note:m9wxtvwy

iinventedlight. 2026. "Python pydoc: generate documentation and online help." iinventedlight Library, iil:note:m9wxtvwy, version of 2026-11-24. https://iinventedlight.com/library/notes/python-pydoc/. License: CC-BY-4.0.

@misc{iil_note_m9wxtvwy,
  author = {{iinventedlight}},
  title = {{Python pydoc: generate documentation and online help}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-24},
  url = {https://iinventedlight.com/library/notes/python-pydoc/},
  note = {Permanent ID iil:note:m9wxtvwy. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/python-pydoc.md.