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

[python]help 函数

2015-11-23 10:44 519 查看
1.在python中,如果对某个函数不了解,可以使用help(‘函数名’)来帮助获得函数的相关信息

示例:

help(raw_input)


运行结果:

Help on function raw_input in module sitecustomize:

raw_input(prompt='')
raw_input([prompt]) -> string

Read a string from standard input.  The trailing newline is stripped.
If the user hits EOF (Unix: Ctl-D, Windows: Ctl-Z+Return), raise EOFError.
On Unix, GNU readline is used if enabled.  The prompt string, if given,
is printed without a trailing newline before reading.


从打印的结果可以看出,raw_input用于从标准输入读取一个字符串。遇到EOF后,开始执行。在Windows下,输入字符串后,按下Enter键即可。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: