Alex Rivera | Logout

How do I export the output of Python's built-in help() function

Asked 2012-06-29T16:31:53.573
32

I've got a python package which outputs considerable help text from: help(package)

I would like to export this help text to a file, in the format in which it's displayed by help(package)

How might I go about this?

Edit
Report

1 Answer

2

If you do help(help) you'll see:

Help on _Helper in module site object:

class _Helper(__builtin__.object)
 |  Define the builtin 'help'.
 |  This is a wrapper around pydoc.help (with a twist).

[rest snipped]

So - you should be looking at the pydoc module - there's going to be a method or methods that return what help(something) does as a string...

answered 2012-06-29T16:42:40.493

Your Answer