如何使用help()命令跳转到指定的函数名称

问题描述 投票:0回答:1

我总是在Python中使用help(object)命令,我想知道是否有任何方法可以跳过大部分文本并跳转到我想要的功能。例如:

>>> import boto
>>> s3 = boto.connect_s3()
>>> help(s3)

它给了我这个对象的很长的描述:

Help on S3Connection in module boto.s3.connection object:
...
...
...
server_name(self, port=None)

为了更清楚,我可以这样做:

>>> help(s3, server_name)
python console helper
1个回答
3
投票

只需传递方法:

help(s3.server_name)
© www.soinside.com 2019 - 2024. All rights reserved.