在Python中行走的拐杖:help() 与 dir()
1.
Python v2.7.1 documentation » The Python Standard Library »
找到help()
help
(
[
object
]
)
Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.
This function is added to the built-in namespace by the site
module.
New in version 2.2.
>>>help(dir) 即可
2. dir()
>>>import copy
>>>[n for n in dir(copy) if not n.startswith('_')]