The Python Help System

python_tutorials

When writing and running your Python programs, you may get stuck and need to get help. You may need to know the meaning of certain modules, classes, functions, keywords, etc. The good news is that Python comes with an built-in help system. This means that you don’t have to seek help outside of Python itself.

In this article, you will learn how to use the built-in Python help system.

Python help() function

This function helps us to get the documentation of a certain class, function, variable, module, etc. The function should be used on the Python console to get details of various Python objects.

Passing an Object to help() Function

The Python help() function has the following syntax:

>>> help(object)

In the above syntax, the object parameter is the name of the object that you need to get help about.

For example, to know more about the Python’s print function, type the following command on the Python console:

>>> help(print)

Output:

Help on built-in function print in module builtins:

print(...)
print(value, ..., sep=' ', end='n', file=sys.stdout, flush=False)

Prints the values to a stream, or to sys.stdout by default.
Optional keyword arguments:
file: a

To finish reading, please visit source site