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

标签 python exception reference

要找到详细说明所有 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/

相关文章:

python - 如何在 python django 中向 Tastypie 返回 json 添加额外的对象

python - 根据其他两列的相等性创建新列

c# - 未处理的异常 CachedRawResponse asp.net

android - 你如何在 Eclipse 中调试 Android

xml - XSD 如何引用不同命名空间中同名的 XML 元素

java - python 中的 TCP 服务器通过 Spring 集成将文件发送到 TCP 客户端

python - 如何在 SqlAlchemy 中进行不带 JOIN 的嵌套 SELECT?

c# - Azure表存储异常处理

C++ 对命名空间 Visual Studio Code 的 undefined reference

c++ - 关于函数引用和线程的问题