python帮助系统函数_【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) forhelp about object.>>>help()
Welcome to Python3.7's help utility!
If thisisyour 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,ortopic to get help on writing
Python programsand 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,ortopics, type"modules", "keywords", "symbols", or "topics". Each module also comes
with a one-line summary of what it does; to list the modules whose nameor summary contain a given string such as "spam", type "modules spam".
help>abs
Help on built-in function abs inmodule builtins:
abs(x,/)
Return the absolute value of the argument.
help>input
Help on built-in function input inmodule builtins:
input(prompt=None, /)
Read a stringfrom standard input. The trailing newline isstripped.
The prompt string,if given, isprinted to standard output without a
trailing newline before reading input.
If the user hits EOF (*nix: Ctrl-D, Windows: Ctrl-Z+Return), raiseEOFError.
On*nix systems, readline is used ifavailable.
help>input()
No Python documentation foundfor 'input()'.
Use help() to get the interactive help utility.
Use help(str)for help on the str class.
help>quit
You are now leaving helpandreturning to the Python interpreter.
If you want to askfor help on a particular object directly fromthe
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-inmodule time:
NAME
time-This module provides various functions to manipulate time values.
DESCRIPTION
There are two standard representations of time. Oneisthe number
of seconds since the Epoch,inUTC (a.k.a. GMT). It may be an integerora floating point number (to represent fractions of seconds).
The Epochis system-defined; on Unix, it is generally January 1st, 1970.
The actual value can be retrieved by calling gmtime(0).
The other representationis a tuple of 9integers 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 is0)
Julian day (dayin the year, 1-366)
DST (Daylight Savings Time) flag (-1, 0 or 1)
If the DST flagis 0, the time is given inthe regular time zone;if it is 1, the time is given inthe DST time zone;if it is -1, mktime() should guess based on the date andtime.
CLASSES
builtins.tuple(builtins.object)
struct_timeclassstruct_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 foundfor '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
備注:
初次編輯時間:2019年9月21日21:08:21
環境:Windows 7? ?/ Python 3.7.2
總結
以上是生活随笔為你收集整理的python帮助系统函数_【Python】【基础知识】【内置函数】【help的使用方法】的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 打破壁垒!看OPPO Find N3让苹
- 下一篇: 李开复回应 Yi 大模型套壳 LLaMA