如何在Python中获得有关已安装模块的函数或方法的帮助?
You can always try help(your_function)
in the Python shell. This will print the documentation ( docstring
in Python lingo) of the corresponding function/class/package/... you're interested in.
If you're using IPython , you can also use your_function?
.
You can use bpython , which has inline help like this:
To find the list of function in the module you can use
dir()
EX:
import os
dir(os)
And to access the docs of the module you can do
os.__doc__
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.