python查看注释_Python-正式文档注释(1)查看文档,python,官方,笔记

本文档记录了Python 3.8.3的内置函数,如dir()和help(),以及如何查看内置模块如__builtins__的详细信息。通过`help(__builtins__)`可以获取所有内置函数的文档,但内容过长,建议读者自行尝试。同时,`__builtins__`不是一个函数集合,因此无法直接通过`__builtins__.__doc__`查看其文档。
摘要由CSDN通过智能技术生成

链接: https://pan.baidu.com/s/1KB_r9OxODpB_DEmWciQLKg 提取码: e5df

楼难爬,难得下载了中文pdf,这里记一下心得!

Python 3.8.3 (tags/v3.8.3:6f8c832, May 13 2020, 22:37:02) [MSC v.1924 64 bit (AMD64)] on win32

The Python Library Reference发布3.8.3

Guido van Rossumand the Python development team

六月23, 2020

Python Software Foundation

Email: docs@python.org

d5aaa3260a0834de556b6dd20ab10f0a.png

library:图书馆

reference:参考

tutorial:教程

1、内置函数

fd5f28bf48f3dc33560b7e914abf2bb4.png

dir()简略查看函数信息 print()

help()详细查看函数信息

list.__doc__ 查看函数list的简介 print()

以下方法可以看到内置函数:__builtins__

In [39]: dir(__builtins__)

Out[39]:

['ArithmeticError',

'AssertionError',

'AttributeError',

'BaseException',

'BlockingIOError',

'BrokenPipeError',

'BufferError',

'BytesWarning',

'ChildProcessError',

'ConnectionAbortedError',

'ConnectionError',

'ConnectionRefusedError',

'ConnectionResetError',

'DeprecationWarning',

'EOFError',

'Ellipsis',

'EnvironmentError',

'Exception',

'False',

'FileExistsError',

'FileNotFoundError',

'FloatingPointError',

'FutureWarning',

'GeneratorExit',

'IOError',

'ImportError',

'ImportWarning',

'IndentationError',

'IndexError',

'InterruptedError',

'IsADirectoryError',

'KeyError',

'KeyboardInterrupt',

'LookupError',

'MemoryError',

'ModuleNotFoundError',

'NameError',

'None',

'NotADirectoryError',

'NotImplemented',

'NotImplementedError',

'OSError',

'OverflowError',

'PendingDeprecationWarning',

'PermissionError',

'ProcessLookupError',

'RecursionError',

'ReferenceError',

'ResourceWarning',

'RuntimeError',

'RuntimeWarning',

'StopAsyncIteration',

'StopIteration',

'SyntaxError',

'SyntaxWarning',

'SystemError',

'SystemExit',

'TabError',

'TimeoutError',

'True',

'TypeError',

'UnboundLocalError',

'UnicodeDecodeError',

'UnicodeEncodeError',

'UnicodeError',

'UnicodeTranslateError',

'UnicodeWarning',

'UserWarning',

'ValueError',

'Warning',

'WindowsError',

'ZeroDivisionError',

'__IPYTHON__',

'__build_class__',

'__debug__',

'__doc__',

'__import__',

'__loader__',

'__name__',

'__package__',

'__pybind11_internals_v3_msvc__',

'__spec__',

'abs',

'all',

'any',

'ascii',

'bin',

'bool',

'breakpoint',

'bytearray',

'bytes',

'callable',

'chr',

'classmethod',

'compile',

'complex',

'copyright',

'credits',

'delattr',

'dict',

'dir',

'display',

'divmod',

'enumerate',

'eval',

'exec',

'filter',

'float',

'format',

'frozenset',

'get_ipython',

'getattr',

'globals',

'hasattr',

'hash',

'help',

'hex',

'id',

'input',

'int',

'isinstance',

'issubclass',

'iter',

'len',

'license',

'list',

'locals',

'map',

'max',

'memoryview',

'min',

'next',

'object',

'oct',

'open',

'ord',

'pow',

'print',

'property',

'range',

'repr',

'reversed',

'round',

'set',

'setattr',

'slice',

'sorted',

'staticmethod',

'str',

'sum',

'super',

'tuple',

'type',

'vars',

'zip']

注意用help的话,可以说一次性看到所有内置函数的文档,因为太长,无法在博客上发布,于是大家自己看吧!

help(__builtins__)

Help on built-in module builtins:

NAME

builtins - Built-in functions, exceptions, and other objects.

DESCRIPTION

Noteworthy: None is the `nil' object; Ellipsis represents `...' in slices.

CLASSES

object

BaseException

Exception

ArithmeticError

FloatingPointError

OverflowError

ZeroDivisionError

AssertionError

AttributeError

BufferError

EOFError

ImportError

ModuleNotFoundError

LookupError

IndexError

KeyError

MemoryError

NameError

UnboundLocalError

OSError

BlockingIOError

ChildProcessError

ConnectionError

BrokenPipeError

ConnectionAbortedError

ConnectionRefusedError

ConnectionResetError

FileExistsError

FileNotFoundError

InterruptedError

IsADirectoryError

NotADirectoryError

PermissionError

ProcessLookupError

TimeoutError

ReferenceError

RuntimeError

NotImplementedError

RecursionError

StopAsyncIteration

StopIteration

SyntaxError

IndentationError

TabError

SystemError

TypeError

ValueError

UnicodeError

UnicodeDecodeError

UnicodeEncodeError

UnicodeTranslateError

Warning

BytesWarning

DeprecationWarning

FutureWarning

ImportWarning

PendingDeprecationWarning

ResourceWarning

RuntimeWarning

SyntaxWarning

UnicodeWarning

UserWarning

GeneratorExit

KeyboardInterrupt

SystemExit

bytearray

bytes

classmethod

complex

dict

enumerate

filter

float

frozenset

int

bool

list

map

memoryview

property

range

reversed

set

slice

staticmethod

str

super

tuple

type

zip

.....

因为__builtins__是一个特定参数,而非一个函数的集合,所以无法使用__builtins__.__doc__查看到信息

函数使用方法,既然可以一次性看到函数的方法,之后大家help(函数)就是。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值