0

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 ...

2 Answers 2

4
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__
Sign up to request clarification or add additional context in comments.

Comments

1

use the doc

print list.__doc__

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.