ITPub博客

首页 > IT职业 > IT职场 > python help()获取函数信息

python help()获取函数信息

IT职场 作者:jinxiaoliang 时间:2021-09-11 09:53:59 0 删除 编辑

1、使用说明

在解释器交互模式下获取特定函数和类别的帮助信息非常实用。

对于内置函数,如果有不清楚的地方,可以使用help()查看说明书。

2、实例

比如查看内置函数 any() 的用法:

>>> help(any) # 只需使用函数名字

将显示出 any() 的帮助信息:

Help on built-in function any in module builtins:
 
any(iterable, /)
    Return True if bool(x) is True for any x in the iterable.
    
    If the iterable is empty, return False.
(END)

按下 q 键退出上述界面。

以上就是python help()获取函数信息的方法,希望对大家有所帮助。更多Python学习指路:python基础教程

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3996/viewspace-2829732/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-10-17

  • 博文量
    73
  • 访问量
    534