2010-03-13 39 views
4

我最近下载IMDbpy模块.. 当我这样做,阅读Python文档的第三方模块

import imdb 
help(imdb) 

我没有得到完整的文件。我需要做的

im = imdb.IMDb() 
help(im) 

看可用的方法。我不喜欢这个控制台界面。有没有更好的阅读文档的方法。我的意思是所有与模块imdb在一个页面中的文档。

回答

10

使用pydoc

pydoc -w imdb 

,这将产生在同一目录imdb.html。


pydoc -p 9090将在端口9090启动一个HTTP服务器,你就可以浏览所有文件在http://localhost:9090/

+0

我试过..但是,仍然我没有得到doc中的“im”方法html –

+0

我仍然没有在文档中获得“im”的方法..为什么答案是upvoted ...? –

+0

你尝试过'pydoc -p'吗? –

1

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 >