Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在“ipython”中,我们some_obj??用来获取文档,它使用“less”来显示文档。我们如何才能将文档从“less”中取出,放入文本编辑器中?内容来自标准输入,因此按“v”会出现错误:“无法编辑标准输入”
some_obj??
some_obj??等效于内置help函数。这是 pydoc.help 的包装。
help
import pydoc doc = pydoc.text.document(some_obj) print doc
您可以将文档保存到文件中。然后在文本编辑器中打开。