pydoc Flashcards
1
Q
pydoc
A
In order to find objects and their documentation, pydoc imports the module(s) to be documented. Therefore, any code on module level will be executed on that occasion. Use an if __name__ == ‘__main__’: guard to only execute code when a file is invoked as a script and not just imported.
The proper syntax for pydoc is Python -m pydoc module where module represents the name of the Python module
pydoc is a self contained executable that can be run from a command line prompt
for example: Python -m pydoc pass will show documentation on pass module within python