gpt4 book ai didi

python - 我在哪里可以找到关于 python 异常的好的引用文档

转载 作者:太空宇宙 更新时间:2023-11-04 11:00:00 26 4
gpt4 key购买 nike

要找到详细说明所有 python 异常的好引用文档似乎并不容易。

例如,每当我遇到 IOError 异常时,它都有不同的消息格式,但我找不到任何好的引用:

IOError: ('http protocol error', 0, 'got a bad status line', None)

IOError: [Errno socket error] [Errno 110] Connection timed out

最佳答案

内置异常是 documented , 这里是 IOException .检查errno符号定义的文档,errno.errorcode 是一个包含错误代码/符号之间映射的字典。

import errno
errno.errorcode[numeric_code]

关于python - 我在哪里可以找到关于 python 异常的好的引用文档,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6397463/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com