Home  >  Article  >  Backend Development  >  where is the python documentation

where is the python documentation

anonymity
anonymityOriginal
2019-06-20 09:34:054841browse

For some unclear modules in Python, you can learn how to use them through the documentation, but where are the Python documentation? We can use Python commands to view this problem.

where is the python documentation

Method 1

Enter the following on the python command line

help(time)                        # 很详细的模块文档
help(time.localtime())            # 很详细的函数文档
help(range)                       # 很详细的类的文档

Method 2

Enter on the python command line The following content

print(time.__doc__)               # 较详细的模块文档
print(time.localtime().__doc__)   # 较详细的函数文档
print(range.__doc__)              # 较详细的类的文档

Method three

Enter the following content on the python command line

print(dir(time))                  # 简略的模块函数显示
print(dir(time.localtime()))      # 简略的函数参数显示
print(dir(range))                 # 简略的类构造函数参数显示

Method four

Enter help() on the python command line, and then Enter time again to get very detailed module documentation

Or enter time.localtime to get a brief function parameter display

Or enter range to get very detailed class documentation

The above is the detailed content of where is the python documentation. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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
Previous article:Do you know Python?Next article:Do you know Python?