Python异常类型及包含关系,设计异常捕获时参考:

BaseException
+-- SystemExit
+-- KeyboardInterrupt
+-- GeneratorExit
+-- Exception
+-- StopIteration
+-- StopAsyncIteration
+-- 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
+-- SyntaxError
| +-- IndentationError
| +-- TabError
+-- SystemError
+-- TypeError
+-- ValueError
| +-- UnicodeError
| +-- UnicodeDecodeError
| +-- UnicodeEncodeError
| +-- UnicodeTranslateError
+-- Warning
+-- DeprecationWarning
+-- PendingDeprecationWarning
+-- RuntimeWarning
+-- SyntaxWarning
+-- UserWarning
+-- FutureWarning
+-- ImportWarning
+-- UnicodeWarning
+-- BytesWarning
+-- ResourceWarning

Python异常类型及包含关系的更多相关文章

  1. Python异常类型及处理、自定义异常类型、断言

    异常的概念.识别报错信息 异常处理 断言的基本使用 异常类型(异常就是报错) 常见异常 NameError:名称错误 SyntaxError:语法错误 TypeError:类型错误 错误回溯 查看报错 ...

  2. python 异常类型----后期需理解调整

    1.Python内建异常体系结构The class hierarchy for built-in exceptions is: BaseException +-- SystemExit +-- Key ...

  3. python 异常类型

    1.NameError:尝试访问一个未申明的变量>>>  vNameError: name 'v' is not defined 2.ZeroDivisionError:除数为0&g ...

  4. 【python】python异常类型

    python2: BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- Stop ...

  5. python异常类型

    python2: BaseException +-- SystemExit +-- KeyboardInterrupt +-- GeneratorExit +-- Exception +-- Stop ...

  6. python 异常类型大全

    try except 处理异常真舒服!!!

  7. 【python基础语法】OS模块处理文件绝对路径,内置的异常类型、捕获、处理(第9天课堂笔记)

    import os """ 通过文件的路径去打开文件 相对路径:相对当前的工作路径去定位文件位置 .:代表当前路径 ..:代表上一级路径(父级路径) 绝对路径:相对于电脑 ...

  8. python 异常

    引用一段来自菜鸟教程的文章:http://www.runoob.com/python/python-exceptions.html Python 异常处理 python提供了两个非常重要的功能来处理p ...

  9. python错误类型

    在运行或编写一个程序时常会遇到错误异常,这时python会给你一个错误提示类名,告诉出现了什么样的问题(Python是面向对象语言,所以程序抛出的异常也是类).能很好的理解这些错误提示类名所代表的意思 ...

随机推荐

  1. logstash split插件的使用(将一个事件拆分成多个事件)

    kafka中的原始数据格式(1条数据) { "body": { "cwd": "/home/test/", "monitor&qu ...

  2. js dom一些操作,记录一下自己写的没有意义,可以简略翻过 第八章

    第八章,一些dom操作,和几个常用的函数 var s= document.getElementById("new"); console.log(s.length); var a= ...

  3. sqlserver datatime value plus random number

    If we want to make some identiity value in sqlserver , we can use identity data type in a table.Howe ...

  4. How to collect TLOG usage status automatically ?

    Yes , in SQLSERVER, we use "DBCC sqlperf(logspace)" to check transaction logfile status.Bu ...

  5. 搭建python运行环境

    一.下载Anaconda Anaconda是Python的包管理器和环境管理器 https://mirrors.tuna.tsinghua.edu.cn/anaconda/archive/ 参考:ht ...

  6. 《C# 爬虫 破境之道》:第二境 爬虫应用 — 第六节:反爬策略研究

    之前的章节也略有提及反爬策略,本节,我们就来系统的对反爬.反反爬的种种,做一个了结. 从防盗链说起: 自从论坛兴起的时候,网上就有很多人会在论坛里发布一些很棒的文章,与当下流行的“点赞”“分享”一样, ...

  7. 全网最全小白搭建Hexo+Gitee/Coding

    全网最全小白搭建Hexo+Gitee/Coding 本站内容已全部转移到https://www.myyuns.ltd,具体请移步到www.myyuns.ltd查看

  8. H5浏览器强制手机横屏

    H5强制手机横屏 1. 通过screen.orientation可以定义手机屏幕的方向,但是lock()方法仅在浏览器已经通过requestFullscreen()切换到全屏模式时起作用,例:强制手机 ...

  9. 算法将一个对象中的某一个key值变为true,其他值都为false

    主要运用在,v-if v-show切换不同内容时,非常快的打开某一个区域,关闭其他的区域哈. 这样就不需要每一个设置false,打开区域设置为true. 可以优化代码哈 for in 主要循环对象(空 ...

  10. 6.【Spring Cloud Alibaba】API网关-SpringCloudGateway

    SpringCloud Gateway是什么?优缺点分析 springCloud Gateway优点 springCloud Gateway缺点 编写SpringCloundGateway pom.x ...