[Tutor] Is there a way I can print the output of help(module)?

Joel Goldstick joel.goldstick at gmail.com
Fri Apr 27 21:11:59 CEST 2012


On Fri, Apr 27, 2012 at 3:03 PM, Steven D'Aprano <steve at pearwood.info> wrote:
> Joel Goldstick wrote:
>>
>> Its really nice how python displays help from the docstrings of
>> modules.  I'd like to save this info to a file, and I realize I've
>> never come across how to do that.
>
>
> At the command prompt (not the Python interactive interpreter!), run the
> pydoc command:
>
> pydoc math
>
> will display the documentation for help.
>
> pydoc -w math
>
> will write it to a file math.html.
>
>
> To do the same thing from the interactive interpreter, start with:
>
> import pydoc
>
> and go from there.
>
>
>
> --
> Steven
>
> _______________________________________________
> Tutor maillist  -  Tutor at python.org
> To unsubscribe or change subscription options:
> http://mail.python.org/mailman/listinfo/tutor

Hey Steven, thanks.

I guess I was a little lazy in my research.  I just discovered pydocs
before I read your response.  Its great!  This is great motivation to
write concise and complete docstrings.

-- 
Joel Goldstick


More information about the Tutor mailing list