The Help function is a built-in function of Python (Python's built-in function can be called directly without import), and it is a python-brought function that can be used at any time. What can I do with the help function, how to see the usage of functions in the Python module, and what to look for in the function with help, let's simply say.
role of the Help () function
When you use Python to write code, you often use Python's own functions or modules, and some of the less commonly used functions or modules are not very clear, so you need to use the Help function to see the aid.
Note here that the Help () function is a detailed description of the purpose of the function or module, and the Dir () function is to see what the action methods within a function or module are, and the output is a list of methods.
How to use the Help function to view the usage of functions in a Python module
Help () Fill in the parameters in parentheses, the operation method is very simple. For example:
The code is as follows:
>>> Help (' dir ')
Help on built-in function dir in module Builtins:
Dir (...)
Dir ([object]), List of strings
If called without an argument, return the names of the current scope.
Else, return an alphabetized list of names comprising (some of) the Attribut
Es
Of the given object, and of attributes reachable from it.
If the object supplies a method named __dir__, it'll be used; otherwise
The default Dir () logic is used and returns:
For a module object:the module ' s attributes.
For a class object:its attributes, and recursively the attributes
of its bases.
For the object:its attributes, its class ' s attributes, and
Recursively the attributes of its class ' s base classes.
Third, use the Help function to view the helper instance
When writing the Help () function using the method, the parentheses fill in the parameters, which should be noted here in the form of the parameter:
1. View Help for a module
The code is as follows:
>>>help (' sys ')
Then it opens the Help document for this module
2. View Help for a data type
The code is as follows:
>>>help (' str ')
Method and detailed description of the return string
The code is as follows:
>>>a = [A]
>>>help (a)
Then Help (a) will open the list operation method
The code is as follows:
>>>help (A.append)
Displays help for the list's Append method