python常见错误和异常
1.BaseExeception 所有异常的基类
2.SystemEixt 解释器请求退出
3.KeyboardInterrupt 用户中断执行
4.Exception 常规错误的基类
5.StopIteration 迭代器没有更多的值
6.ArithmeticError 所有数值计算错误的基类
7.FloatingPointError 浮点计算错误的基类
8.OverflowError 数值运算潮湿处最大限制
9.ZeroDivisionError除零错误
10.AssertionError断言语句失败
11.AttributeError对象没有这个属性
12.EOFError没有内键输入,到达EOF 标记
13.IOError输入/输出操作失败
14.OSError 操作系统错误
15.ImportError导入模块失败
16.IndexError序列中没有此索引
17.KeyError映射中没有这个键
18.NameError为声明的变量名
19.SyntaxError语法错误
20.TanError Tab和空格混用
21.TypeError对类型无效的操作
22.ValueError传入无效的参数
python常见错误和异常的更多相关文章
- python 常见错误和异常 函数 正则表达式及多线程编程
生成随机密码#!/usr/bin/env python import stringfrom random import choice def gen_pass(num=9): all_chs = st ...
- python的错误和异常
python错误和异常 错误 错误分为语法错误和逻辑错误 语法错误 >>> if File "<stdin>", line 1 if ^ Syntax ...
- python之错误和异常
错误 分为语法错误和逻辑错误,如下: 语法错误指示软件的结构上有错误,导致不能被解释器解释或编译器编译. 逻辑错误可能是由于不完整或是不合法的输入所致,或者是无法生成.计算.或是输出结果需要的过程无法 ...
- python常见错误总结
TypeError: 'module' object is not callable 模块未正确导入,层级关系没找对 缩进错误. IndentationError: unindent does not ...
- python常见错误
最近刚刚接触Python,为了养成好习惯,遇到了诸多的问题,林林总总,在这里简单记录下: 编写简单的python语句时: module level import not at top of file ...
- Python常见错误:IndexError: list index out of range
用python写脚本查询字典时,在遍历字典时循环到某一项时老是报错 出现这种错误有两种情况: 第1种可能情况 list[index]index超出范围 第2种可能情况 list是空值就会出现 In ...
- 【python+selenium学习】Python常见错误之:IndentationError: unexpected indent
初入python+selenium学习之路,总会遇到这样那样的问题.IndentationError: unexpected indent,这个坑我已经踏进数次了,索性记录下来.都知道Python对代 ...
- SyntaxError :invalid syntax Python常见错误
1.忘记在 if , elif , else , for , while , class ,def 声明末尾添加 ":" 2.使用 = 而不是 ==,= 是赋值操作符而 == 是等 ...
- IndexError: list index out of range Python常见错误
引用超过list最大索引,此错误非常常见,注意列表的元素个数 ----------------------------------------------
随机推荐
- codeforces 11B Jumping Jack
Jack is working on his jumping skills recently. Currently he's located at point zero of the number l ...
- React Toolchains
React Toolchains Create React App / component library https://create-react-app.dev/docs/getting-star ...
- GitHub user language statistics
GitHub user language statistics 2020 https://madnight.github.io/githut/#/pull_requests/2020/2 2011 ~ ...
- node.js 如何处理一个很大的文件
node.js 如何处理一个很大的文件 思路 arraybuffer 数据分段 时间分片 多线程 web workers sevice workers node.js 如何处理一个很大的文件 http ...
- Rust learning notes
Rust learning notes Rust Version 1.42.0 $ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs ...
- how to close macos eject icon from menu bar
how to close macOS eject icon from the menu bar close eject https://apple.stackexchange.com/question ...
- express+apollo+mongodb
阿波罗服务器入门 λ yarn add --dev @babel/core @babel/cli @babel/preset-env λ yarn add --dev nodemon // " ...
- CAD颜色对照表
cad颜色代码与RGB参数对应表 1 255 0 02 255 255 03 0 255 04 0 255 2555 0 0 2556 255 0 2557 0 0 08 128 128 1289 1 ...
- Mac mini M1使用简单体验(编程、游戏、深度学习)
好久不见了各位! 前一阵子忍不住剁手买了M1芯片的mac mini,为了弥补自己的内疚感就卖了自己的旧的mbp2017款.数据也完全迁移到了新机器上,之前的工作也就由mbp2017彻底换成mac mi ...
- c# 打印面单
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e) { ...