python一标准异常总结大全(非常全)
| AssertionError | 断言语句(assert)失败 |
| AttributeError | 尝试访问未知的对象属性 |
| EOFError | 用户输入文件末尾标志EOF(Ctrl+d) |
| FloatingPointError | 浮点计算错误 |
| GeneratorExit | generator.close()方法被调用的时候 |
| ImportError | 导入模块失败的时候 |
| IndexError | 索引超出序列的范围 |
| KeyError | 字典中查找一个不存在的关键字 |
| KeyboardInterrupt | 用户输入中断键(Ctrl+c) |
| MemoryError | 内存溢出(可通过删除对象释放内存) |
| NameError | 尝试访问一个不存在的变量 |
| NotImplementedError | 尚未实现的方法 |
| OSError | 操作系统产生的异常(例如打开一个不存在的文件) |
| OverflowError | 数值运算超出最大限制 |
| ReferenceError | 弱引用(weak reference)试图访问一个已经被垃圾回收机制回收了的对象 |
| RuntimeError | 一般的运行时错误 |
| StopIteration | 迭代器没有更多的值 |
| SyntaxError | Python的语法错误 |
| IndentationError | 缩进错误 |
| TabError | Tab和空格混合使用 |
| SystemError | Python编译器系统错误 |
| SystemExit | Python编译器进程被关闭 |
| TypeError | 不同类型间的无效操作 |
| UnboundLocalError | 访问一个未初始化的本地变量(NameError的子类) |
| UnicodeError | Unicode相关的错误(ValueError的子类) |
| UnicodeEncodeError | Unicode编码时的错误(UnicodeError的子类) |
| UnicodeDecodeError | Unicode解码时的错误(UnicodeError的子类) |
| UnicodeTranslateError | Unicode转换时的错误(UnicodeError的子类) |
| ValueError | 传入无效的参数 |
| ZeroDivisionError | 除数为零 |
以下是 Python 内置异常类的层次结构:
BaseException
+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit
+-- Exception
+-- StopIteration
+-- ArithmeticError
| +-- FloatingPointError
| +-- OverflowError
| +-- ZeroDivisionError
+-- AssertionError
+-- AttributeError
+-- BufferError
+-- EOFError
+-- ImportError
+-- 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
+-- SyntaxError
| +-- IndentationError
| +-- TabError
+-- SystemError
+-- TypeError
+-- ValueError
| +-- UnicodeError
| +-- UnicodeDecodeError
| +-- UnicodeEncodeError
| +-- UnicodeTranslateError
+-- Warning
+-- DeprecationWarning
+-- PendingDeprecationWarning
+-- RuntimeWarning
+-- SyntaxWarning
+-- UserWarning
+-- FutureWarning
+-- ImportWarning
+-- UnicodeWarning
+-- BytesWarning
+-- ResourceWarning
python一标准异常总结大全(非常全)的更多相关文章
- python第六天 函数 python标准库实例大全
今天学习第一模块的最后一课课程--函数: python的第一个函数: 1 def func1(): 2 print('第一个函数') 3 return 0 4 func1() 1 同时返回多种类型时, ...
- Python标准异常topic
Python标准异常topic AssertionError 断言语句 (assert) ...
- Python 标准异常
异常名称 描述 BaseException 所有异常的基类 SystemExit 解释器请求退出 KeyboardInterrupt 用户中断执行(通常是输入^C) Exception 常规错误的 ...
- Python标准异常总结
Python标准异常总结 AssertionError 断言语句(assert)失败 AttributeError 尝试访问未知的对象属性 EOFError 用户输入文件末尾标志EOF(Ctrl+d ...
- python标准异常
什么是异常? 异常即是一个事件,该事件会在程序执行过程中发生,影响了程序的正常执行.一般情况下,在Python无法正常处理程序时就会发生一个异常.异常是Python对象,表示一个错误.当Python脚 ...
- 19 Python标准异常总结 (转)
Python标准异常总结 AssertionError 断言语句(assert)失败 AttributeError 尝试访问未知的对象属性 EOFError 用户输入文件末尾标志EOF(Ctrl+d) ...
- Python标准异常和异常处理详解
python提供了两个非常重要的功能来处理python程序在运行中出现的异常和错误.你可以使用该功能来调试python程序. 1.异常处理: 本站Python教程会具体介绍. 2.断言(Asserti ...
- python——标准异常总结
请参考此网站: Python 标准异常总结 https://fishc.com.cn/forum.php?mod=viewthread&tid=45814&extra=page%3D1 ...
- python所有的标准异常类:
异常名称 描述 BaseException 所有异常的基类 SystemExit 解释器请求退出 KeyboardInterrupt 用户中断执行(通常是输入^C) Exception 常规错误的基类 ...
随机推荐
- mybatis的resultMap自定义结果映射规则
dao接口 User myGetUserById(Integer id); sql xml自定义封装规则 <!--自定义某个javabean的封装规则 type:自定义规则的java类型 id: ...
- StringJoiner
示例一 public class StringJoinerTest1 { public static void main(String[] args) { StringJoiner joiner = ...
- 移动端meta标签的设置
var phoneWidth = parseInt(window.screen.width); var phoneScale = phoneWidth / 640; var ua = navigato ...
- 【NodeJS】使用busboy上传文件
router.post('/upload', function (req, res) { var busboy = new Busboy({ headers: req.headers }); busb ...
- asp.net mvc5 step by step(一)——CURD增删查改Demo
1. 新建一个项目:
- python类的反射使用方法
曾经,博主的房东养了只金毛叫奶茶,今天就拿它当议题好了. 博主写本文时正在被广州的蚊子围攻. #反射练习 class animal(object): def __init__(self,name,fo ...
- linux系统可执行文件添加环境变量使其跨终端和目录执行
在命令行终端输入:echo $PATH 回车可打印出PATH变量对应的路径 现有一可执行文件qtFirstC,文件所在目录为:/home/lolors/qtFirstC 此时test只能在此目录下运行 ...
- react-router-dom和本地服务本地开发 (node、webpack)
场景 使用react 做开发,避免会使用react-router React Router 已经是V4的版本 React Router 目前已经被划分成了三个包:react-router,react- ...
- spring-quartz 定时器 给targetMethod传递参数
今天在做一个项目的时候,要给一个定时器任务的执行方法传递参数,在网上找了一下资料,可以使用arguments参数: <bean id="subsidyJobDetail" ...
- Android中的AutoCompleteTextView(随笔提示文本)组件的简单使用
Android中的随笔提示文本组件AutoCompleteTextView的使用,此组件用于输入文本,然后就会在所配置的适配器中的数据进行查找显示在组件下面. 这里值得注意的是AutoComplete ...