Python内置函数(29)——help
英文文档:
help
([object])
Invoke the built-in help system. (This function is intended for interactive use.) If no argument is given, the interactive help system starts on the interpreter console. If the argument is a string, then the string is looked up as the name of a module, function, class, method, keyword, or documentation topic, and a help page is printed on the console. If the argument is any other kind of object, a help page on the object is generated.
This function is added to the built-in namespace by the site
module.
说明:
1. 在解释器交互界面,不传参数调用函数时,将激活内置的帮助系统,并进入帮助系统。在帮助系统内部输入模块、类、函数等名称时,将显示其使用说明,输入quit退出内置帮助系统,并返回交互界面。
- >>> help() #不带参数
- Welcome to Python 3.5's help utility!
- If this is your first time using Python, you should definitely check out
- the tutorial on the Internet at http://docs.python.org/3.5/tutorial/.
- Enter the name of any module, keyword, or topic to get help on writing
- Python programs and using Python modules. To quit this help utility and
- return to the interpreter, just type "quit".
- To get a list of available modules, keywords, symbols, or topics, type
- "modules", "keywords", "symbols", or "topics". Each module also comes
- with a one-line summary of what it does; to list the modules whose name
- or summary contain a given string such as "spam", type "modules spam".
- #进入内置帮助系统 >>> 变成了 help>
- help> str #str的帮助信息
- Help on class str in module builtins:
- class str(object)
- | str(object='') -> str
- | str(bytes_or_buffer[, encoding[, errors]]) -> str
- |
- | Create a new string object from the given object. If encoding or
- | errors is specified, then the object must expose a data buffer
- | that will be decoded using the given encoding and error handler.
- | Otherwise, returns the result of object.__str__() (if defined)
- | or repr(object).
- | encoding defaults to sys.getdefaultencoding().
- | errors defaults to 'strict'.
- |
- | Methods defined here:
- |
- | __add__(self, value, /)
- | Return self+value.
- ................................
- help> 1 #不存在的模块名、类名、函数名
- No Python documentation found for ''.
- Use help() to get the interactive help utility.
- Use help(str) for help on the str class.
- help> quit #退出内置帮助系统
- You are now leaving help and returning to the Python interpreter.
- If you want to ask for help on a particular object directly from the
- interpreter, you can type "help(object)". Executing "help('string')"
- has the same effect as typing a particular string at the help> prompt.
- # 已退出内置帮助系统,返回交互界面 help> 变成 >>>
- >>>
2. 在解释器交互界面,传入参数调用函数时,将查找参数是否是模块名、类名、函数名,如果是将显示其使用说明。
- >>> help(str)
- Help on class str in module builtins:
- class str(object)
- | str(object='') -> str
- | str(bytes_or_buffer[, encoding[, errors]]) -> str
- |
- | Create a new string object from the given object. If encoding or
- | errors is specified, then the object must expose a data buffer
- | that will be decoded using the given encoding and error handler.
- | Otherwise, returns the result of object.__str__() (if defined)
- | or repr(object).
- | encoding defaults to sys.getdefaultencoding().
- | errors defaults to 'strict'.
- |
- | Methods defined here:
- |
- | __add__(self, value, /)
- | Return self+value.
- |
- ***************************
Python内置函数(29)——help的更多相关文章
- Python内置函数(29)——slice
英文文档: class slice(stop) class slice(start, stop[, step]) Return a slice object representing the set ...
- 【转】python 内置函数总结(大部分)
[转]python 内置函数总结(大部分) python 内置函数大讲堂 python全栈开发,内置函数 1. 内置函数 python的内置函数截止到python版本3.6.2,现在python一共为 ...
- python内置函数,匿名函数
一.匿名函数 匿名函数:为了解决那些功能很简单的需求而设计的一句话函数 def calc(n): return n**n print(calc(10)) #换成匿名函数 calc = lambda n ...
- python 内置函数总结(大部分)
python 内置函数大讲堂 python全栈开发,内置函数 1. 内置函数 python的内置函数截止到python版本3.6.2,现在python一共为我们提供了68个内置函数.它们就是pytho ...
- Python内置函数和内置常量
Python内置函数 1.abs(x) 返回一个数的绝对值.实参可以是整数或浮点数.如果实参是一个复数,返回它的模. 2.all(iterable) 如果 iterable 的所有元素为真(或迭代器为 ...
- Python | 内置函数(BIF)
Python内置函数 | V3.9.1 | 共计155个 还没学完, 还没记录完, 不知道自己能不能坚持记录下去 1.ArithmeticError 2.AssertionError 3.Attrib ...
- python内置函数
python内置函数 官方文档:点击 在这里我只列举一些常见的内置函数用法 1.abs()[求数字的绝对值] >>> abs(-13) 13 2.all() 判断所有集合元素都为真的 ...
- python 内置函数和函数装饰器
python内置函数 1.数学相关 abs(x) 取x绝对值 divmode(x,y) 取x除以y的商和余数,常用做分页,返回商和余数组成一个元组 pow(x,y[,z]) 取x的y次方 ,等同于x ...
- Python基础篇【第2篇】: Python内置函数(一)
Python内置函数 lambda lambda表达式相当于函数体为单个return语句的普通函数的匿名函数.请注意,lambda语法并没有使用return关键字.开发者可以在任何可以使用函数引用的位 ...
随机推荐
- Webpack 开发服务器代理设置解决跨域问题
在前端开发过程中,可能会遇到跨域问题,在 webpack 设置中对 devServer 配置代理即可解决跨域问题,具体设置如下: webpack.config.js module.exports = ...
- Jquery DataTable初探
最近在做公司的后台模版,表格渲染都是用的datatable,现在来总结一下常用用法. datatable中文网参考链接 配置介绍 1. "aLengthMenu": [ [5, 1 ...
- 在VUE-CLI 3下的第一个Element-ui项目(菜鸟专用)
vue-cli3.0使用及配置 (https://www.cnblogs.com/xzqyun/p/10779891.html ) 以上是 vue-cli3.0使用及配置 这里我们来引用基于v ...
- UICollectionView使用相关博文链接
有关UICollectionView的几篇文章:1.UICollectionView简介及简单示例: http://puttin.github.io/blog/2013/04/08/a-simple- ...
- 结队第一次 plus
作业描述 作业所属课程:软件工程1916|W(福州大学) 作业要求:结对第一次-原型设计 结对学号:221600328 221600106 作业目标:尝试结对合作,使用NABCD模型,会分析用户需求, ...
- pip install –r ./requirements.txt 报错 改成 pip install -r requirements.txt 成功
Invalid requirement: '–r'Traceback (most recent call last): File "/home/dev/.pyenv/versions/3.6 ...
- python3 替换字符串中指定位置字符
大家都知道字符串在python中是不可变数据类型,那么我们如何替换字符串中指定位置的字符呢? 字符串转换列表替换并转换解决: def replace_char(string,char,index): ...
- Django合集
Django基础 Django--简介 Django--web框架简介 浅析uWSGI.uwsgi.wsgi Django--url(路由)配置 Django--模板层 Django--视图层 Dja ...
- JOISC2019 游记
JOISC2019 游记 Day 1: 試験 (Examination) 题目大意: 有\(n(n\le10^5)\)个人,每个人有两种属性\(s_i,t_i\).\(q(q\le10^5)\)次询问 ...
- vue-cli利用router创建单页面
一.创建脚手架 第一步 打开命令输入vue init webpack-simple vue-name 下载webpack-simple (vue-name是你要创建的项目名称) 第二步 输入cd v ...