Python help函数命令怎么使用
help函数是python的一个内置函数,在python基础知识中介绍过什么是内置函数,它是python自带的函数,任何时候都可以被使。help函数能作什么、怎么使用help函数查看python模块学习中函数的用法,和使用help函数时需要注意哪些问题,下面来简单的说一下。
help函数能作什么
在使用python来编写代码时,会经常使用python 调用函数自带函数或模块,一些不常用的函数或是模块的用途不是很清楚,这时候就需要用到help函数来查看帮助。
这里要注意下,help()函数是查看函数或模块用途的详细说明,而dir()函数是查看函数或模块内的操作方法都有什么,输出的是方法列表。
怎么使用help函数查看python模块中函数的用法
help( )括号内填写参数,操作方法很简单。
使用help函数查看帮助时需要注意哪些问题
在写help()函数使用方法时说过,括号中填写参数,那在这里要注意参数的形式:
1、查看一个模块的帮助
>>>help('sys')
之后它回打开这个模块的帮助文档
2、查看一个数据类型的帮助
>>>help('str')
返回字符串的方法及详细说明
>>>a = [1,2,3]
>>>help(a)
这时help(a)则会打开list的操作方法
>>>help(a.append)
会显示list的append方法的帮助
浏览这篇文章的用户,正在关注:
python 函数返回值
玩蛇网文章,转载请注明出处和文章网址:https://www.iplaypy.com/jichu/help.html
相关文章 Recommend
- • 2019年3月最新消息: Python 3.4.10 现已推出
- • [上海]招Python量化系统开发工程师
- • 优集品网络科技有限公司招Python中/高级工程师
- • 爱因互动科技发展有限公司招募Python开发攻城狮
- • mozio招聘Python/Django工程师
- • Kavout金融科技公司招Python研发工程师
- • Python数组逆向输出,编程练习题实例四十
- • Python数组插入排序,编程练习题实例三十九
- • Python矩阵for循环应用,编程练习题实例三十八
- • Python操作Redis数据库方面的问题
- • 请python高手帮我看看这段python代码中函数setter的
- • Python什么方法可以快速将两个队列变成字典
PYTHON基础入门必备教程 Must Know PYTHON Tutorials
- • python 解释器
- • python idle
- • python dir函数
- • python 数据类型
- • python type函数
- • python 字符串
- • python 整型数字
- • python 列表
- • python 元组
- • python 字典
- • python 集合
- • python 变量
- • python print
- • python 函数
- • python 类定义
- • python import
- • python help
- • python open
- • python 异常处理
- • python 注释
- • python continue
- • python pass
- • python return
- • python global
- • python assert
- • python if语句
- • python break
- • python for循环
- • python while循环
- • python else/elif
- • lambda匿名函数
PYTHON进阶提高必备教程 Must Know PYTHON Modules
- • os 模块
- • sys 模块
- • re 正则表达式
- • time 日期时间
- • pickle 持久化
- • random 随机
- • csv 模块
- • logging 日志
- • socket网络通信
- • json模块
- • urlparse 解析URL
- • urllib 模块
- • urllib2 模块
- • robotparser 解析
- • Cookie 模块
- • smtplib 邮件
- • Base64 编码
- • xmlrpclib客户端
- • string 文本
- • Queue 线程安全
- • math数学计算
- • linecache缓存
- • threading多线程
- • sqlite3数据库
- • gzip压缩解压
最新内容 NEWS
- • Pyhton 单行、多行注释符号使用方法及规范
- • Python List 列表list()方法
- • Python QQ群 基础编程开发qq群 python编程交
- • Python type()函数用途及使用方法
- • Python idle安装与使用教程 调试、下载
- • Python 集合set()添加删除、交集、并集、集
- • Python 函数是什么?如何定义、调用函数
- • Python 变量的定义命名规范和赋值
- • Python int 数字整型类型 定义int()范围大小
- • Python 元组遍历排序操作方法
图文精华 RECOMMEND
-
Pyhton 单行、多行注释符号使用方
-
Python List 列表list()方法
-
Python QQ群 基础编程开发qq群 pyt
-
Python type()函数用途及使用方法
-
Python idle安装与使用教程 调试、下
-
Python 集合set()添加删除、交集、并
热点文章 HOT
- Python List 列表list()方法
- Python 类class定义 方法与属性教程
- Python 元组遍历排序操作方法
- Python 映射类型字典dict操作定义
- Python 函数是什么?如何定义、调用函数
- Python 标准操作符与逻辑运算符
- Python 集合set()添加删除、交集、并集、集
- Python idle安装与使用教程 调试、下载
- Python基本内置数据类型有哪些?
- Python 字符串是什么及简单操作方法