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

前端 未结 9 1068
时光取名叫无心
时光取名叫无心 2020-12-15 20:19

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 w

9条回答
  •  [愿得一人]
    2020-12-15 20:24

    In Windows, just open up a Windows Command Line window, go to the Lib subfolder of your Python installation, and type

    python pydoc.py moduleName.memberName > c:\myFolder\memberName.txt

    to put the documentation for the property or method memberName in moduleName into the file memberName.txt. If you want an object further down the hierarchy of the module, just put more dots. For example

    python pydoc.py wx.lib.agw.ultimatelistctrl > c:\myFolder\UltimateListCtrl.txt

    to put the documentation on the UltimateListCtrl control in the agw package in the wxPython package into UltimateListCtrl.txt.

提交回复
热议问题