[英]How can I list the methods in a Python 2.5 module?
以下是您至少可以做的一些事情:
import module
print dir(module) # Find functions of interest.
# For each function of interest:
help(module.interesting_function)
print module.interesting_function.func_defaults
这也很不错:
import module
help(module)
它将打印模块的docstring,然后列出模块的内容,也打印他们的文档字符串。
dir()函数显示模块具有的所有成员。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.