如何找到 Python 内置函数?
How can I find Python Built-in functions?
我浏览了 python 2x 和 3x 文档。它只提到以下内容 -
The Python interpreter has a number of functions and types built into it that are always available.
这些内置方法如何以及在哪里自由浮动?
Python 不是基于面向对象的,它也可以是 functional.However 如果你想寻找你可以在解释器中输入的函数和它们的方法
>>>dir(__builtins__)
这会获取目录中的内置函数和变量列表,您也可以通过键入
来使用变通方法
>>>help('module')
或
>>help(function-name)
我浏览了 python 2x 和 3x 文档。它只提到以下内容 -
The Python interpreter has a number of functions and types built into it that are always available.
这些内置方法如何以及在哪里自由浮动?
Python 不是基于面向对象的,它也可以是 functional.However 如果你想寻找你可以在解释器中输入的函数和它们的方法
>>>dir(__builtins__)
这会获取目录中的内置函数和变量列表,您也可以通过键入
来使用变通方法>>>help('module')
或
>>help(function-name)