您的位置:首页 > 编程语言 > Python开发

Python中help() 与 dir()

2016-07-28 20:24 435 查看
在Python中行走的拐杖:help() 与 dir()

1. 

Python v2.7.1 documentation » The Python Standard Library »

2. Built-in Functions

找到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('_')]

 

Python v2.7.1 documentation » 
The Python Standard Library »

 

Python v2.7.1 documentation » 
The Python Standard Library »
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  python help