HTML reports
For people who prefer a more visual help tool, or prefer to keep a browser open, PyDoc includes the ability to create HTML files from the official Python documentation. Depending on the version of Python being used, there are several different ways to access the HTML information.
How to do it...
- Starting in Python 3.2, help web pages can be opened by using
python -m pydoc -b
. If you have both Python 2 and 3 installed, you can specify which Python version you desire to work with; for example,python3 -m pydoc -b
. If you are using Python 2, then use the commandpython -m pydoc -p <port>
. The port number can be 0, which will pick a random, unused port address for the web server. - Regardless of which version you use, it should open up a web page similar to the following screenshot:
- All of the modules available in Python are shown as hyperlinks. You can also search for entries via the
Search
box; alternatively, if you know the name of the module you're interested in, enter it directly...