[英]Reading Python Documentation for 3rd party modules
我最近下载了IMDbpy模块..当我这样做时,
import imdb
help(imdb)
我没有得到完整的文档..我必须这样做
im = imdb.IMDb()
help(im)
查看可用的方法。 我不喜欢这个控制台界面。 有没有更好的阅读文档的方法。 我是指在一个页面中与模块imdb相关的所有文档。 。
使用pydoc
pydoc -w imdb
这将在同一目录中生成imdb.html。
pydoc -p 9090
将在端口9090上启动HTTP服务器,您将能够在http:// localhost:9090 /浏览所有文档
在IPython中你可以做到
[1]: import os
[2]: os?
< get the full documentation here >
# or you could do it on specific functions
[3]: os.uname
<built-in function>
[4]: os.uname?
< get the full documentation here >
# Incase of modules written in python, you could inspect source code by doing
[5]: import string
[6]: string??
< hows the source code of the module >
[7]: string.upper??
< shows the source code of the function >
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.