英文文档:

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退出内置帮助系统,并返回交互界面。

  1. >>> help() #不带参数
  2.  
  3. Welcome to Python 3.5's help utility!
  4.  
  5. If this is your first time using Python, you should definitely check out
  6. the tutorial on the Internet at http://docs.python.org/3.5/tutorial/.
  7.  
  8. Enter the name of any module, keyword, or topic to get help on writing
  9. Python programs and using Python modules. To quit this help utility and
  10. return to the interpreter, just type "quit".
  11.  
  12. To get a list of available modules, keywords, symbols, or topics, type
  13. "modules", "keywords", "symbols", or "topics". Each module also comes
  14. with a one-line summary of what it does; to list the modules whose name
  15. or summary contain a given string such as "spam", type "modules spam".
  16.  
  17. #进入内置帮助系统 >>> 变成了 help>
  18. help> str #str的帮助信息
  19. Help on class str in module builtins:
  20.  
  21. class str(object)
  22. | str(object='') -> str
  23. | str(bytes_or_buffer[, encoding[, errors]]) -> str
  24. |
  25. | Create a new string object from the given object. If encoding or
  26. | errors is specified, then the object must expose a data buffer
  27. | that will be decoded using the given encoding and error handler.
  28. | Otherwise, returns the result of object.__str__() (if defined)
  29. | or repr(object).
  30. | encoding defaults to sys.getdefaultencoding().
  31. | errors defaults to 'strict'.
  32. |
  33. | Methods defined here:
  34. |
  35. | __add__(self, value, /)
  36. | Return self+value.
  37. ................................
  38.  
  39. help> 1 #不存在的模块名、类名、函数名
  40. No Python documentation found for ''.
  41. Use help() to get the interactive help utility.
  42. Use help(str) for help on the str class.
  43.  
  44. help> quit #退出内置帮助系统
  45.  
  46. You are now leaving help and returning to the Python interpreter.
  47. If you want to ask for help on a particular object directly from the
  48. interpreter, you can type "help(object)". Executing "help('string')"
  49. has the same effect as typing a particular string at the help> prompt.
  50.  
  51. # 已退出内置帮助系统,返回交互界面 help> 变成 >>>
  52. >>>

  2. 在解释器交互界面,传入参数调用函数时,将查找参数是否是模块名、类名、函数名,如果是将显示其使用说明。

  1. >>> help(str)
  2. Help on class str in module builtins:
  3.  
  4. class str(object)
  5. | str(object='') -> str
  6. | str(bytes_or_buffer[, encoding[, errors]]) -> str
  7. |
  8. | Create a new string object from the given object. If encoding or
  9. | errors is specified, then the object must expose a data buffer
  10. | that will be decoded using the given encoding and error handler.
  11. | Otherwise, returns the result of object.__str__() (if defined)
  12. | or repr(object).
  13. | encoding defaults to sys.getdefaultencoding().
  14. | errors defaults to 'strict'.
  15. |
  16. | Methods defined here:
  17. |
  18. | __add__(self, value, /)
  19. | Return self+value.
  20. |
  21. ***************************

Python内置函数(29)——help的更多相关文章

  1. Python内置函数(29)——slice

    英文文档: class slice(stop) class slice(start, stop[, step]) Return a slice object representing the set ...

  2. 【转】python 内置函数总结(大部分)

    [转]python 内置函数总结(大部分) python 内置函数大讲堂 python全栈开发,内置函数 1. 内置函数 python的内置函数截止到python版本3.6.2,现在python一共为 ...

  3. python内置函数,匿名函数

    一.匿名函数 匿名函数:为了解决那些功能很简单的需求而设计的一句话函数 def calc(n): return n**n print(calc(10)) #换成匿名函数 calc = lambda n ...

  4. python 内置函数总结(大部分)

    python 内置函数大讲堂 python全栈开发,内置函数 1. 内置函数 python的内置函数截止到python版本3.6.2,现在python一共为我们提供了68个内置函数.它们就是pytho ...

  5. Python内置函数和内置常量

    Python内置函数 1.abs(x) 返回一个数的绝对值.实参可以是整数或浮点数.如果实参是一个复数,返回它的模. 2.all(iterable) 如果 iterable 的所有元素为真(或迭代器为 ...

  6. Python | 内置函数(BIF)

    Python内置函数 | V3.9.1 | 共计155个 还没学完, 还没记录完, 不知道自己能不能坚持记录下去 1.ArithmeticError 2.AssertionError 3.Attrib ...

  7. python内置函数

    python内置函数 官方文档:点击 在这里我只列举一些常见的内置函数用法 1.abs()[求数字的绝对值] >>> abs(-13) 13 2.all() 判断所有集合元素都为真的 ...

  8. python 内置函数和函数装饰器

    python内置函数 1.数学相关 abs(x) 取x绝对值 divmode(x,y) 取x除以y的商和余数,常用做分页,返回商和余数组成一个元组 pow(x,y[,z]) 取x的y次方 ,等同于x ...

  9. Python基础篇【第2篇】: Python内置函数(一)

    Python内置函数 lambda lambda表达式相当于函数体为单个return语句的普通函数的匿名函数.请注意,lambda语法并没有使用return关键字.开发者可以在任何可以使用函数引用的位 ...

随机推荐

  1. Webpack 开发服务器代理设置解决跨域问题

    在前端开发过程中,可能会遇到跨域问题,在 webpack 设置中对 devServer 配置代理即可解决跨域问题,具体设置如下: webpack.config.js module.exports = ...

  2. Jquery DataTable初探

    最近在做公司的后台模版,表格渲染都是用的datatable,现在来总结一下常用用法. datatable中文网参考链接 配置介绍 1. "aLengthMenu": [ [5, 1 ...

  3. 在VUE-CLI 3下的第一个Element-ui项目(菜鸟专用)

    vue-cli3.0使用及配置 (https://www.cnblogs.com/xzqyun/p/10779891.html  ) 以上是  vue-cli3.0使用及配置   这里我们来引用基于v ...

  4. UICollectionView使用相关博文链接

    有关UICollectionView的几篇文章:1.UICollectionView简介及简单示例: http://puttin.github.io/blog/2013/04/08/a-simple- ...

  5. 结队第一次 plus

    作业描述 作业所属课程:软件工程1916|W(福州大学) 作业要求:结对第一次-原型设计 结对学号:221600328 221600106 作业目标:尝试结对合作,使用NABCD模型,会分析用户需求, ...

  6. 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 ...

  7. python3 替换字符串中指定位置字符

    大家都知道字符串在python中是不可变数据类型,那么我们如何替换字符串中指定位置的字符呢? 字符串转换列表替换并转换解决: def replace_char(string,char,index): ...

  8. Django合集

    Django基础 Django--简介 Django--web框架简介 浅析uWSGI.uwsgi.wsgi Django--url(路由)配置 Django--模板层 Django--视图层 Dja ...

  9. JOISC2019 游记

    JOISC2019 游记 Day 1: 試験 (Examination) 题目大意: 有\(n(n\le10^5)\)个人,每个人有两种属性\(s_i,t_i\).\(q(q\le10^5)\)次询问 ...

  10. vue-cli利用router创建单页面

    一.创建脚手架 第一步 打开命令输入vue init webpack-simple vue-name 下载webpack-simple  (vue-name是你要创建的项目名称) 第二步 输入cd v ...