阅读第三方模块的 Python 文档

发布于 2024-08-24 19:33:06 字数 250 浏览 1 评论 0原文

我最近下载了 IMDbpy 模块.. 当我这样做时,

import imdb
help(imdb)

我没有得到完整的文档。我必须做

im = imdb.IMDb()
help(im)

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

I recently downloaded IMDbpy module..
When I do,

import imdb
help(imdb)

i dont get the full documentation.. I have to do

im = imdb.IMDb()
help(im)

to see the available methods. I dont like this console interface. Is there any better way of reading the doc. I mean all the doc related to module imdb in one page..

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

山人契 2024-08-31 19:33:06

使用 pydoc

pydoc -w imdb

这将在同一目录中生成 imdb.html。


pydoc -p 9090 将在端口 9090 上启动 HTTP 服务器,您将能够浏览 处的所有文档http://localhost:9090/

Use pydoc

pydoc -w imdb

This will generate imdb.html in the same directory.


pydoc -p 9090 will start a HTTP server on port 9090, and you will be able to browse all documentation at http://localhost:9090/

热鲨 2024-08-31 19:33:06

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 >

in IPython you could do

[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 >
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文