How to read the help file in python? Here are several ways to view help documents in Python:
help()
The help function is a built-in function of Python
Function prototype : help([object])
can help us learn more about the object.
can be either a module or a function in the module
For example: help(math) / help(math. sin)
dir()
The dir function is a built-in function of python
Function prototype: dir([object])
can help us get the object Most relevant properties.
You need to import the corresponding module first before you can view the properties and methods of the module.
For example:
import math dir(math)
doc
There is a wonderful feature in python, document strings, which are also called DocStrings.
For example:
math.doc
View the built-in module sys.bultin_modulenames
For example:
import sys sys.bultin_modulenames
pydoc
python -m pydoc raw_input (view function) View pydoc usage under cmd
pydoc -h
The above is the detailed content of How to read the help file in python. For more information, please follow other related articles on the PHP Chinese website!