Python pydoc模块

 

The pydoc module imports a Python module and uses the contents to generate help text at runtime. The output includes docstrings for any objects that have them, and all of the documentable contents of the module are described.

Plain Text Help

Running:

$ pydoc atexit

Produces plaintext help on the console, using your pager if one is configured.

HTML Help

You can also cause pydoc to generate HTML output, either writing a static file to a local directory or starting a web server to browse documentation online.

$ pydoc -w atexit

Creates atexit.html in the current directory.

$ pydoc -p 5000

Starts a web server listening at http://localhost:5000/. The server generates documentation as you browse through the available modules.

Interactive Help

pydoc also adds a function help() to the __builtins__ so you can access the same information from the Python interpreter prompt.

$ python
Python 2.6.2 (r262:71600, Apr 16 2009, 09:17:39)
[GCC 4.0.1 (Apple Computer, Inc. build 5250)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> help('atexit')
Help on module atexit:

NAME
    atexit

FILE
    /Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/atexit.py
...

 

 

 

 

 

 

看了以下2篇文章:

 

http://www.ibm.com/developerworks/cn/linux/sdk/python/charm-19/

 

http://blog.csdn.net/hoxide/article/details/51506

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值