문제

In "ipython", we use some_obj?? to get documentation, which uses "less" to show the docs. How can we get the document out of "less", into a text editor? The content is fed from stdin, so pressing "v" gives the error: "can not edit standard input"

도움이 되었습니까?

해결책

some_obj?? is equivalent the built-in help function. This is a wrapper around pydoc.help.

import pydoc
doc = pydoc.text.document(some_obj)
print doc

You may save the documentation to a file. Then open in a text editor.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top