Home > Backend Development > Python Tutorial > How to read the help file in python

How to read the help file in python

爱喝马黛茶的安东尼
Release: 2019-06-20 15:11:01
Original
3867 people have browsed it

How to read the help file in python

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)
Copy after login

doc
There is a wonderful feature in python, document strings, which are also called DocStrings.
For example:

math.doc
Copy after login

View the built-in module sys.bultin_modulenames

For example:

import sys
sys.bultin_modulenames
Copy after login

pydoc
python -m pydoc raw_input (view function) View pydoc usage under cmd

pydoc -h
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template