Reputation: 4105
As a example :
>>> out = help(list) ## out must be a string .
>>> print out
>>> ' Help on class list in module __builtin__:
class list(object)
| list() -> new empty list
| list(iterable) -> new list initialized from iterable's items '
Any advice highly appreciated ...
Upvotes: 0
Views: 113
Reputation: 287885
import pydoc
pydoc.render_doc(list)
gives the whole output of help(list)
. If you're just interested in the top description (and not all methods defined on the object), use
list.__doc__
Upvotes: 4