首页 > 编程语言 > 详细

[python]help 函数

时间:2015-11-23 11:32:24      阅读:362      评论:0      收藏:0      [点我收藏+]

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键即可。

[python]help 函数

原文:http://www.cnblogs.com/sophia194910/p/4987669.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!