help() function

Fernando Pérez fperez528 at yahoo.com
Mon Nov 4 19:51:30 EST 2002


Chris Spencer wrote:

>         Is there any way to get the same docstring formatting that help()
>         uses,
> but be able to capture it to a variable or a file handle?
>         Inquiring minds want to know.
> 

You can redirect sys.stdout to whatever you want. Just wrap the help() call 
and trap stdout access to a file. I bet you can do it in under 10 lines.

Cheers,

f.



More information about the Python-list mailing list