LinuxCommandLibrary

pydoc

View Python module documentation

TLDR

View module documentation

$ pydoc [module]
copy
Search documentation
$ pydoc -k [keyword]
copy
Start documentation server
$ pydoc -p [8080]
copy
Write documentation to file
$ pydoc -w [module]
copy
Browser mode
$ pydoc -b
copy

SYNOPSIS

pydoc [options] [module]

DESCRIPTION

pydoc is Python's built-in documentation tool that displays module documentation generated from docstrings and introspection. It can show documentation for modules, classes, functions, and keywords in the terminal, search across all installed modules with -k, or generate static HTML files with -w.
The -p flag starts a local HTTP documentation server that provides a browsable interface to all installed Python modules, and -b opens this server automatically in the default web browser. pydoc is part of the Python standard library and provides the same functionality as the interactive help() function.

PARAMETERS

MODULE

Module to document.
-k KEYWORD
Search keyword.
-p PORT
Start HTTP server.
-w
Write HTML file.
-b
Open in browser.

CAVEATS

Built into Python. Uses docstrings.

HISTORY

pydoc is Python's built-in documentation viewer.

SEE ALSO

python(1), help(1), sphinx(1)

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community