我的系统上安装了一个python模块,我想知道其中有哪些函数/类/方法可用。
我想调用每个函数的Doc函数。在Ruby中,我可以做一些类似classname.methods的事情来获取该类上所有可用方法的列表。在python中有类似的东西吗?
比如:
from somemodule import foo
print foo.methods # or whatever is the correct method to call
请考虑审阅所选答案!在其他答案中有更好/更容易使用的解决方案。
您可以使用dir(module)查看所有可用的方法/属性。还可以查看pydocs。