Python: import pydoc and then use it natively?

I know how to use pydoc from the command line. However, due to the complex setup of the environment, it would be preferable to run it in a python script as a built-in API call. That is, my python runner looks something like this:

import pydoc pydoc.generate_html_docs_for (some file)

However, it is not clear to me from the pydoc documentation which function calls I need to use for this behavior to work. Any ideas?

+4
source share
1 answer

Do you mean something like this?

>>> import pydoc >>> pydoc.writedoc('sys') wrote sys.html >>> 
+5
source

All Articles