【Python】【基础知识】【内置函数】【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.
Changed in version 3.4: Changes to pydoc and inspect mean that the reported signatures for callables are now more comprehensive and consistent.
————————(我是分割线)————————
中文解释
调用内置的帮助系统。(这个函数用于交互模式使用)
如果未给出参数,则交互帮助系统将在解释器控制台上启动。
示例:
>>> help
Type help() for interactive help, or help(object) for help about object.
>>> help() Welcome to Python 3.7's help utility! If this is your first time using Python, you should definitely check out
the tutorial on the Internet at https://docs.python.org/3.7/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> abs
Help on built-in function abs in module builtins: abs(x, /)
Return the absolute value of the argument. help> input
Help on built-in function input in module builtins: input(prompt=None, /)
Read a string from standard input. The trailing newline is stripped. The prompt string, if given, is printed to standard output without a
trailing newline before reading input. If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raise EOFError.
On *nix systems, readline is used if available. help> input()
No Python documentation found for 'input()'.
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.
>>>
---退出帮助模式使用quit
如果参数是字符串,则该字符串将作为模块、函数、类、方法、关键字或文档主题的名称查找,并在控制台上打印帮助页。
>>> help("time")
Help on built-in module time:
NAME
time - This module provides various functions to manipulate time values.
DESCRIPTION
There are two standard representations of time. One is the number
of seconds since the Epoch, in UTC (a.k.a. GMT). It may be an integer
or a floating point number (to represent fractions of seconds).
The Epoch is system-defined; on Unix, it is generally January 1st, 1970.
The actual value can be retrieved by calling gmtime(0).
The other representation is a tuple of 9 integers giving local time.
The tuple items are:
year (including century, e.g. 1998)
month (1-12)
day (1-31)
hours (0-23)
minutes (0-59)
seconds (0-59)
weekday (0-6, Monday is 0)
Julian day (day in the year, 1-366)
DST (Daylight Savings Time) flag (-1, 0 or 1)
If the DST flag is 0, the time is given in the regular time zone;
if it is 1, the time is given in the DST time zone;
if it is -1, mktime() should guess based on the date and time.
CLASSES
builtins.tuple(builtins.object)
struct_time
class struct_time(builtins.tuple)
| struct_time(iterable=(), /)
.
.
.
.
.
.
如果参数是任何其他类型的对象,则会生成该对象的帮助页。
>>> a = "test"
>>> help(a)
Help on package test: NAME
test - # Dummy file to make this directory a package. PACKAGE CONTENTS
__main__
_test_multiprocessing
ann_module
ann_module2
ann_module3
audiotests
autotest
bad_coding
bad_coding2
bad_getattr
bad_getattr2
bad_getattr3
badsyntax_3131
badsyntax_future10
badsyntax_future3
badsyntax_future4
badsyntax_future5
badsyntax_future6
badsyntax_future7
badsyntax_future8
badsyntax_future9
badsyntax_pep3120
bisect
bytecode_helper
.
.
.
.
.
.
>>> help("ls")
No Python documentation found for 'ls'.
Use help() to get the interactive help utility.
Use help(str) for help on the str class.
此函数由站点模块添加到内置命名空间中。
版本3.4中的更改:pydoc和inspect的更改意味着所报告的可调用签名现在更加全面和一致。
———————(我是分割线)————————

————————(我是分割线)————————
参考:
1. Python 3.7.2 documentation
2. RUNOOB.COM:https://www.runoob.com/python/python-func-help.html
备注:
初次编辑时间:2019年9月21日21:08:21
环境:Windows 7 / Python 3.7.2
【Python】【基础知识】【内置函数】【help的使用方法】的更多相关文章
- 十六. Python基础(16)--内置函数-2
十六. Python基础(16)--内置函数-2 1 ● 内置函数format() Convert a value to a "formatted" representation. ...
- 十五. Python基础(15)--内置函数-1
十五. Python基础(15)--内置函数-1 1 ● eval(), exec(), compile() 执行字符串数据类型的python代码 检测#import os 'import' in c ...
- python基础(15):内置函数(一)
1. 内置函数 什么是内置函数? 就是python给你提供的,拿来直接⽤的函数,比如print,input等等,截⽌到python版本3.6.2 python⼀共提供了68个内置函数.他们就是pyth ...
- python基础(内置函数+文件操作+lambda)
一.内置函数 注:查看详细猛击这里 常用内置函数代码说明: # abs绝对值 # i = abs(-123) # print(i) #返回123,绝对值 # #all,循环参数,如果每个元素为真,那么 ...
- Python基础:内置函数
本文基于Python 3.6.5的标准库文档编写,罗列了英文文档中介绍的所有内建函数,并对其用法进行了简要介绍. 下图来自Python官网:展示了所有的内置函数,共计68个(14*4+12),大家可以 ...
- 第六篇:python基础_6 内置函数与常用模块(一)
本篇内容 内置函数 匿名函数 re模块 time模块 random模块 os模块 sys模块 json与pickle模块 shelve模块 一. 内置函数 1.定义 内置函数又被称为工厂函数. 2.常 ...
- Python基础编程 内置函数
内置函数 内置函数(一定记住并且精通) print()屏幕输出 int():pass str():pass bool():pass set(): pass list() 将一个可迭代对象转换成列表 t ...
- Python基础_内置函数
Built-in Functions abs() delattr() hash() memoryview() set() all() dict() help() min() setat ...
- python基础(16):内置函数(二)
1. lamda匿名函数 为了解决⼀些简单的需求⽽设计的⼀句话函数 # 计算n的n次⽅ def func(n): return n**n print(func(10)) f = lambda n: n ...
- 学习PYTHON之路, DAY 4 - PYTHON 基础 4 (内置函数)
注:查看详细请看https://docs.python.org/3/library/functions.html#next 一 all(), any() False: 0, Noe, '', [], ...
随机推荐
- pdf缩略图生成上传解决方案
前言:因自己负责的项目(jetty内嵌启动的SpringMvc)中需要实现文件上传,而自己对java文件上传这一块未接触过,且对 Http 协议较模糊,故这次采用渐进的方式来学习文件上传的原理与实践. ...
- 实现类数组转化成数组(DOM 操作获得的返回元素值是一个类数组)
目标 实现类数组转化成数组 实例 链接地址 使用方法 const foo = document.querySelectorAll('.result') //链接地址输入控制台输入这行代码 const ...
- JavaWeb_(Hibernate框架)Hibernate中事务
Hibernate中事务 事务的性质 事物的隔离级别 配置事务的隔离级别 事务的性质 原子性:原子,不可再分,一个操作不能分为更小的操作,要么全都执行,要么全不执行. 一致性:事务在完成时,必须使得所 ...
- Java 读取模板并生成HTML静态文件实例
原理都很简单,主要是对模板的解析.so,我们先准备一个html模板mb.html,做个文件其中的###title###之类的标签用于程序进行查询替换. HTML code复制代码 <html&g ...
- 如何阅读《JavaScript高级程序设计》(一)
题外话 最近在看<JavaScript高级程序设计>这本书,面对着700多页的厚书籍,心里有点压力,所以我决定梳理一下..探究一下到底怎么读这本书.本书的内容好像只有到ES5...所以只能 ...
- (转)linux中wget未找到命令
转:https://blog.csdn.net/djj_alice/article/details/80407769 在装数据库的时候发现无法使用wget命令,提示未找到命令,如图所示 那是因为没有安 ...
- 域名与服务器 ip地址的理解
域名 服务器 ip地址具有怎样的关系呢 通俗的讲,我们访问一个网站就相当于访问一个服务器的文件,如果想要通过自己的域名来访问一个网站,首先得将域名部署到你的服务器上,然后就可以通过域名访问到你服务器上 ...
- 阿里云服务器ECS装好宝塔 但访问不了面板的解决方法
(SSH) (phpmyadmin) 如果你进入面板里修改了面板端口或FTP端口,记得要在安全组和面板防火墙放行相应端口
- 在Ubuntu 16.04配置VNC Server (灰屏问题解决)
使用命令安装 sudo apt install xfce4 xfce4-goodies tightvncserver 编辑vnc启动文件,安全期间最好备份一下 mv ~/.vnc/xstartup ...
- DP&图论 DAY 5 上午
DP&图论 DAY 5 上午 POJ 1125 Stockbroker Grapevine 有 N 个股票经济人可以互相传递消息,他们之间存在一些单向的通信路径.现在有一个消息要由某个人开 ...