tags:

views:

112

answers:

1

I know how to use pydoc from the command line. However, because of complicated environmental setup, it would be preferable to run it within a python script as a native API call. That is, my python runner looks a bit like this:

import pydoc pydoc.generate_html_docs_for(someFile)

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

Thanks, --Steve

+1  A: 

Do you mean something like this?

>>> import pydoc
>>> pydoc.writedoc('sys')
wrote sys.html
>>>
Roberto Liffredo
Yep, pretty much. I found additional docs on the help(obj) call. However, it tells me "no python doc found for <myfile>". However, my file definitely has pydoc-friendly info in it. Any ideas?
Stephen Gross
You have to add it to sys path. impot syssys.path.append(your_module_path)
Lucas S.
On an unrelated note, I strongly suggest you using IPython. It will help you in finding this kind of information very easily.
Roberto Liffredo