Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/281.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否有一个';人';对于python?_Python - Fatal编程技术网

是否有一个';人';对于python?

是否有一个';人';对于python?,python,Python,我想知道是否有像“man.py”这样的CLI专门用于Python 前, 最简单的方法是在shell上使用pydoc function,其中function是内置函数的名称或模块中函数的限定名称(module.function): > PAGER=cat pydoc urllib.urlencode [adrian@hades:~]> PAGER=cat pydoc urllib.urlencode Help on function urlencode in urllib: urll

我想知道是否有像“man.py”这样的CLI专门用于Python

前,


最简单的方法是在shell上使用
pydoc function
,其中
function
是内置函数的名称或模块中函数的限定名称(
module.function
):

> PAGER=cat pydoc urllib.urlencode
[adrian@hades:~]> PAGER=cat pydoc urllib.urlencode
Help on function urlencode in urllib:

urllib.urlencode = urlencode(query, doseq=0)
    Encode a sequence of two-element tuples or dictionary into a URL query string.
...
PAGER=cat
仅用于在此处复制和复制)

使用IPython时,您可以使用
function?
查看
function
function???
的文档字符串,以获得更详细的视图,其中包括用python编写的函数的完整源代码


在普通的python shell中,您可以使用
help(function)
进行此操作。但是,我认为IPython方式更舒适。

pydoc模块提供了:

$ python -m pydoc os.system
Help on built-in function system in os:

os.system = system(...)
    system(command) -> exit_status

    Execute the command (a string) in a subshell.
$

?函数
,它等于
函数
$ python -m pydoc os.system
Help on built-in function system in os:

os.system = system(...)
    system(command) -> exit_status

    Execute the command (a string) in a subshell.
$