python是一種簡單易學且功能壯大的編程說話,它具有白話化的釀成體例,深受大師喜愛。跟著人工智能的成長,python越來越受大師喜愛。在利用python編程的過程中我們總會碰到各類各樣的問題,可是我們總會找到解決的方案的。例如下面的這個問題,若何利用好python的help功能。
起首進入python shell界面,不會的話看我前面的經驗吧。
輸入help,彈出了提醒:Type help() for interactive help, or help(object) for help about object.需要交互式的幫忙的話輸入help();需要查看某個對象的幫忙的話用help(對象)。
我們進入交互式幫忙界面。help()
進入交互式幫忙界面,號令提醒釀成了這樣。
Welcome to Python 3.6'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.6/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".
若是我想獲取input函數的功能,輸入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.
這個功能將在進修中起到很大的幫忙,不外需要看得懂英語。那么怎么退出幫忙號令行呢?輸入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.
0 篇文章
如果覺得我的文章對您有用,請隨意打賞。你的支持將鼓勵我繼續創作!