English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The help() method calls the built-in Python help system.
The syntax of help() is:
help(object)
The help() method can use at most one parameter.
object (Optional)-You want to generate the given help object
The help() method is used for interactive use. When you need to write Python programs and usePython modulesIt is recommended to try using it in the interpreter when helping.
Try these in the Python shell.
>>> help(list)
>>> help(dict)
>>> help(print)
>>> help([1, 2, 3)
If a string is passed as an argument, the name of the module, function, class, method, keyword, or documentation topic, as well as the help page, will be printed.
If a string is passed as an argument, the given string is searched as the name of a module, function, class, method, keyword, or documentation topic, and the help page is printed.
Try these in the Python shell.
>>> help('random thing')
>>> help('print')
>>> help('def')
>>> from math import * help('math.pow')
If no arguments are passed, Python's help utility (interactive help system) will start on the console.
>>> help()
Then, you can enter the name of the topic to get help on writing Python programs and using Python modules. For example:
help> True
help> 'print'
help > print
To exit the help utility and return to the interpreter, you need to enterquitand press the Enter key.
help > quit