• linkedu视频
  • 平面设计
  • 电脑入门
  • 操作系统
  • 办公应用
  • 电脑硬件
  • 动画设计
  • 3D设计
  • 网页设计
  • CAD设计
  • 影音处理
  • 数据库
  • 程序设计
  • 认证考试
  • 信息管理
  • 信息安全
菜单
linkedu.com
  • 网页制作
  • 数据库
  • 程序设计
  • 操作系统
  • CMS教程
  • 游戏攻略
  • 脚本语言
  • 平面设计
  • 软件教程
  • 网络安全
  • 电脑知识
  • 服务器
  • 视频教程
  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell
您的位置:首页 > 脚本语言 >python > Python help()函数用法详解

Python help()函数用法详解

作者: 字体:[增加 减小] 来源:互联网

通过本文主要向大家介绍了python help函数,python help,python help怎么用,python help print,python中help等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com

help函数是python的一个内置函数(python的内置函数可以直接调用,无需import),它是python自带的函数,任何时候都可以被使用。help函数能作什么、怎么使用help函数查看python模块中函数的用法,和使用help函数时需要注意哪些问题,下面来简单的说一下。

一、help()函数的作用
在使用python来编写代码时,会经常使用python自带函数或模块,一些不常用的函数或是模块的用途不是很清楚,这时候就需要用到help函数来查看帮助。
这里要注意下,help()函数是查看函数或模块用途的详细说明,而dir()函数是查看函数或模块内的操作方法都有什么,输出的是方法列表。
二、怎么使用help函数查看python模块中函数的用法
help()括号内填写参数,操作方法很简单。例如:

dir(...)
    dir([object]) -> list of strings

    If called without an argument, return the names in the current scope.
    Else, return an alphabetized list of names comprising (some of) the attribut
es
    of the given object, and of attributes reachable from it.
    If the object supplies a method named __dir__, it will be used; otherwise
    the default dir() logic is used and returns:
      for a module object: the module's attributes.
      for a class object:  its attributes, and recursively the attributes
        of its bases.
      for any other object: its attributes, its class's attributes, and
        recursively the attributes of its class's base classes.</div>

三、使用help函数查看帮助实例

在写help()函数使用方法时说过,括号中填写参数,那在这里要注意参数的形式:

1、查看一个模块的帮助
</div>

您可能想查找下面的文章:

  • Python help()函数用法详解

相关文章

  • python正则表达式之作业计算器
  • 在arcgis使用python脚本进行字段计算时是如何解决中文问题的
  • Python中dictionary items()系列函数的用法实例
  • Django中使用group_by的方法
  • Python正则表达式匹配HTML页面编码
  • python中zip和unzip数据的方法
  • Python批量修改文本文件内容的方法
  • python计算一个序列的平均值的方法
  • python中Genarator函数用法分析
  • python字典基本操作实例分析

文章分类

  • vbs
  • DOS/BAT
  • hta/htc
  • python
  • perl
  • VBA
  • ColdFusion
  • ruby
  • PowerShell
  • Lua
  • Golang
  • linux shell

最近更新的内容

    • python超简单解决约瑟夫环问题
    • Python读取mp3中ID3信息的方法
    • python实现博客文章爬虫示例
    • 使用FastCGI部署Python的Django应用的教程
    • python 接口_从协议到抽象基类详解
    • Python文件夹与文件的操作实现代码
    • Python简单获取自身外网IP的方法
    • python计算时间差的方法
    • 跟老齐学Python之类的细节
    • Python中Collection的使用小技巧

关于我们 - 联系我们 - 免责声明 - 网站地图

©2020-2025 All Rights Reserved. linkedu.com 版权所有