Documentation

Jason Drew jasondrew72 at gmail.com
Wed Aug 10 11:30:18 EDT 2005


The standard pydoc module is very useful. A simple example of how you
could use it:

>>> import pydoc
>>> mymodule = pydoc.importfile(r"C:\My Py\my_foo.py")
>>> html = pydoc.html.page(pydoc.describe(mymodule), pydoc.html.document(mymodule))
>>> open("foo.html", "w").write(html)

Then you have a nice foo.html document for your module.

The above isn't necessarily the best way to use pydoc though it's
useful for a single-file bunch of classes. The documentation on pydoc
seems pretty sketchy, but reading the pydoc.py file is a good way to
learn how to use it.




More information about the Python-list mailing list