Python pydoc Module
Example
Render a short help text for a built-in using pydoc.render_doc():
import pydoc
s = pydoc.render_doc(len, title="Help on %s")
print(s.splitlines()[0])
Try it Yourself »
Definition and Usage
The pydoc module generates and shows documentation for Python modules, classes, and functions.
Use it to render text/HTML docs, locate objects by name, and open help in a pager or web browser.
Members
| Member | Description |
|---|---|
| help | Convenience function similar to the interactive help(). |
| HTMLDoc | Formatter that produces HTML documentation. |
| importfile() | Import a Python source file by path (without touching sys.modules much). |
| locate() | Find an object by its dotted path name. |
| render_doc() | Return a text help page for an object. |
| TextDoc | Formatter that produces plain text documentation. |