是的,您可以致电help(whatever)
在Python交互式解释器中。
>>> help
Type help() for interactive help, or help(object) for help about object.
>>> help(zip)
Help on built-in function zip in module __builtin__:
zip(...)
zip(seq1 [, seq2 [...]]) -> [(seq1[0], seq2[0] ...), (...)]
Return a list of tuples, where each tuple contains the i-th element
from each of the argument sequences. The returned list is truncated
in length to the length of the shortest argument sequence.
您甚至可以传递(引用的)关键字并获得非常详细的帮助:
>>> help('if')
The ``if`` statement
********************
The ``if`` statement is used for conditional execution:
if_stmt ::= "if" expression ":" suite
( "elif" expression ":" suite )*
["else" ":" suite]
It selects exactly one of the suites by evaluating the expressions one
by one until one is found to be true (see section *Boolean operations*
for the definition of true and false); then that suite is executed
(and no other part of the ``if`` statement is executed or evaluated).
If all expressions are false, the suite of the ``else`` clause, if
present, is executed.
Related help topics: TRUTHVALUE
>>> help('def')
Function definitions
********************
A function definition defines a user-defined function object
....
甚至一般主题:
>>> help('FUNCTIONS')
Functions
*********
Function objects are created by function definitions. The only
operation on a function object is to call it: ``func(argument-list)``.
There are really two flavors of function objects: built-in functions
and user-defined functions. Both support the same operation (to call
the function), but the implementation is different, hence the
different object types.
See *Function definitions* for more information.
Related help topics: def, TYPES
- http://docs.python.org/2/library/functions.html#help
调用内置帮助系统。 (此函数用于交互式使用。)如果未给出参数,交互式帮助系统将在解释器控制台上启动。
如果参数是字符串,则将该字符串查找为模块、函数、类、方法、关键字或文档主题的名称,并在控制台上打印帮助页面。
如果参数是任何其他类型的对象,则会生成该对象的帮助页面。