簡體   English   中英

閱讀第三方模塊的Python文檔

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM