二十九、pycharm中报错“too many blank lines (3) ”等类似错误
报错如下图:

解决方法一:
鼠标移至报错处,按住Alt+enter键,选择ignore errors like this

方法二:找到设置File - Settings…… - Editor - Inspections中找到PEP8 coding style violation,在右下角ignore error中添加报错id

附件:
或者警告id地址:http://pep8.readthedocs.io/en/latest/intro.html#configuration
| code | sample message |
|---|---|
| E1 | Indentation |
| E101 | indentation contains mixed spaces and tabs |
| E111 | indentation is not a multiple of four |
| E112 | expected an indented block |
| E113 | unexpected indentation |
| E114 | indentation is not a multiple of four (comment) |
| E115 | expected an indented block (comment) |
| E116 | unexpected indentation (comment) |
| E121 (*^) | continuation line under-indented for hanging indent |
| E122 (^) | continuation line missing indentation or outdented |
| E123 (*) | closing bracket does not match indentation of opening bracket’s line |
| E124 (^) | closing bracket does not match visual indentation |
| E125 (^) | continuation line with same indent as next logical line |
| E126 (*^) | continuation line over-indented for hanging indent |
| E127 (^) | continuation line over-indented for visual indent |
| E128 (^) | continuation line under-indented for visual indent |
| E129 (^) | visually indented line with same indent as next logical line |
| E131 (^) | continuation line unaligned for hanging indent |
| E133 (*) | closing bracket is missing indentation |
| E2 | Whitespace |
| E201 | whitespace after ‘(‘ |
| E202 | whitespace before ‘)’ |
| E203 | whitespace before ‘:’ |
| E211 | whitespace before ‘(‘ |
| E221 | multiple spaces before operator |
| E222 | multiple spaces after operator |
| E223 | tab before operator |
| E224 | tab after operator |
| E225 | missing whitespace around operator |
| E226 (*) | missing whitespace around arithmetic operator |
| E227 | missing whitespace around bitwise or shift operator |
| E228 | missing whitespace around modulo operator |
| E231 | missing whitespace after ‘,’, ‘;’, or ‘:’ |
| E241 (*) | multiple spaces after ‘,’ |
| E242 (*) | tab after ‘,’ |
| E251 | unexpected spaces around keyword / parameter equals |
| E261 | at least two spaces before inline comment |
| E262 | inline comment should start with ‘# ‘ |
| E265 | block comment should start with ‘# ‘ |
| E266 | too many leading ‘#’ for block comment |
| E271 | multiple spaces after keyword |
| E272 | multiple spaces before keyword |
| E273 | tab after keyword |
| E274 | tab before keyword |
| E275 | missing whitespace after keyword |
| E3 | Blank line |
| E301 | expected 1 blank line, found 0 |
| E302 | expected 2 blank lines, found 0 |
| E303 | too many blank lines (3) |
| E304 | blank lines found after function decorator |
| E305 | expected 2 blank lines after end of function or class |
| E306 | expected 1 blank line before a nested definition |
| E4 | Import |
| E401 | multiple imports on one line |
| E402 | module level import not at top of file |
| E5 | Line length |
| E501 (^) | line too long (82 > 79 characters) |
| E502 | the backslash is redundant between brackets |
| E7 | Statement |
| E701 | multiple statements on one line (colon) |
| E702 | multiple statements on one line (semicolon) |
| E703 | statement ends with a semicolon |
| E704 (*) | multiple statements on one line (def) |
| E711 (^) | comparison to None should be ‘if cond is None:’ |
| E712 (^) | comparison to True should be ‘if cond is True:’ or ‘if cond:’ |
| E713 | test for membership should be ‘not in’ |
| E714 | test for object identity should be ‘is not’ |
| E721 (^) | do not compare types, use ‘isinstance()’ |
| E722 | do not use bare except, specify exception instead |
| E731 | do not assign a lambda expression, use a def |
| E741 | do not use variables named ‘l’, ‘O’, or ‘I’ |
| E742 | do not define classes named ‘l’, ‘O’, or ‘I’ |
| E743 | do not define functions named ‘l’, ‘O’, or ‘I’ |
| E9 | Runtime |
| E901 | SyntaxError or IndentationError |
| E902 | IOError |
| W1 | Indentation warning |
| W191 | indentation contains tabs |
| W2 | Whitespace warning |
| W291 | trailing whitespace |
| W292 | no newline at end of file |
| W293 | blank line contains whitespace |
| W3 | Blank line warning |
| W391 | blank line at end of file |
| W5 | Line break warning |
| W503 (*) | line break before binary operator |
| W504 (*) | line break after binary operator |
| W505 (*^) | doc line too long (82 > 79 characters) |
| W6 | Deprecation warning |
| W601 | .has_key() is deprecated, use ‘in’ |
| W602 | deprecated form of raising exception |
| W603 | ‘<>’ is deprecated, use ‘!=’ |
| W604 | backticks are deprecated, use ‘repr()’ |
| W605 | invalid escape sequence ‘x’ |
| W606 | ‘async’ and ‘await’ are reserved keywords starting with Python 3.7 |
二十九、pycharm中报错“too many blank lines (3) ”等类似错误的更多相关文章
- Bootstrap <基础二十九>面板(Panels)
Bootstrap 面板(Panels).面板组件用于把 DOM 组件插入到一个盒子中.创建一个基本的面板,只需要向 <div> 元素添加 class .panel 和 class .pa ...
- Web 开发人员和设计师必读文章推荐【系列二十九】
<Web 前端开发精华文章推荐>2014年第8期(总第29期)和大家见面了.梦想天空博客关注 前端开发 技术,分享各类能够提升网站用户体验的优秀 jQuery 插件,展示前沿的 HTML5 ...
- WCF技术剖析之二十九:换种不同的方式调用WCF服务[提供源代码下载]
原文:WCF技术剖析之二十九:换种不同的方式调用WCF服务[提供源代码下载] 我们有两种典型的WCF调用方式:通过SvcUtil.exe(或者添加Web引用)导入发布的服务元数据生成服务代理相关的代码 ...
- VMwarevSphere 服务器虚拟化之二十九 桌面虚拟化之安装View副本服务器
VMwarevSphere 服务器虚拟化之二十九 桌面虚拟化之安装View副本服务器 VMware View中高可用性可是一个必须要考虑的问题.在整个虚拟桌面环境中View Connection S ...
- Bootstrap入门(二十九)JS插件6:弹出框
Bootstrap入门(二十九)JS插件6:弹出框 加入小覆盖的内容,像在iPad上,用于存放非主要信息 弹出框是依赖于工具提示插件的,那它也和工具提示是一样的,是需要初始化才能够使用的 首先我们引入 ...
- mysql进阶(二十九)常用函数
mysql进阶(二十九)常用函数 一.数学函数 ABS(x) 返回x的绝对值 BIN(x) 返回x的二进制(OCT返回八进制,HEX返回十六进制) CEILING(x) 返回大于x的最小整数值 EXP ...
- JAVA之旅(二十九)——文件递归,File结束练习,Properties,Properties存取配置文件,load,Properties的小练习
JAVA之旅(二十九)--文件递归,File结束练习,Properties,Properties存取配置文件,load,Properties的小练习 我们继续学习File 一.文件递归 我们可以来实现 ...
- 【黑金原创教程】【FPGA那些事儿-驱动篇I 】原创教程连载导读【连载完成,共二十九章】
前言: 无数昼夜的来回轮替以后,这本<驱动篇I>终于编辑完毕了,笔者真的感动到连鼻涕也流下来.所谓驱动就是认识硬件,还有前期建模.虽然<驱动篇I>的硬件都是我们熟悉的老友记,例 ...
- 第三百二十九节,web爬虫讲解2—urllib库爬虫—ip代理—用户代理和ip代理结合应用
第三百二十九节,web爬虫讲解2—urllib库爬虫—ip代理 使用IP代理 ProxyHandler()格式化IP,第一个参数,请求目标可能是http或者https,对应设置build_opener ...
随机推荐
- HTTP报文结构和内容(转)
HTTP请求报文格式就如下图所示: 1. 请求报文 一个HTTP请求报文由请求行(request line).请求头部(header).空行和请求数据4个部分组成. 大致结构是这样的: <req ...
- 什么是lambda函数?有什么好处?
lambda 函数是一个可以接收任意多个参数(包括可选参数)并且返回单个表达式值的匿名函数 好处:1.lambda 函数比较轻便,即用即删除,很适合需要完成一项功能,但是此功能只在此一处使用,连名字都 ...
- AXI总线协议
AXI总线协议 (一).概述 AXI (高性能扩展总线接口,Advanced eXtensible Interface)是ARM AMBA 单片机总线系列中的一个协议,是计划用于高性能.高主频的系统设 ...
- tabcontrol动态生成选项卡,并且在选项卡中添加窗体
http://blog.csdn.net/zx13525079024/article/details/6084733 今天在论坛上看到有人问到,如果在点击TRVEVIEW时动态生成tabcontrol ...
- #define 宏实现函数功能可能存在的问题
#define 宏实现函数功能的问题 情形1 #define free_ptr(p) \ if(p) delete p; p = nullptr; 在调用free_ptr(p)的地方展开看这段代码: ...
- Pure播放器
我是的本地应用,并不会拿你的隐私数据.
- Red Hat Enterprise Linux查看系统版本命令
# arch 返回结果为i686表示32位系统,x86_64表示64位系统. # uname -a # uname -r # lsb_release -a # cat /proc/version # ...
- Python 余弦相似度与皮尔逊相关系数 计算
夹角余弦(Cosine) 也可以叫余弦相似度. 几何中夹角余弦可用来衡量两个向量方向的差异,机器学习中借用这一概念来衡量样本向量之间的差异. (1)在二维空间中向量A(x1,y1)与向量B(x2,y2 ...
- php 操作分表代码
//哈希分表 function get_hash_table($table, $userid) { $str = crc32($userid); if ($str < 0) { $hash = ...
- [ZJOI2007]最大半连通子图(Tarjan,拓扑序DP)
[ZJOI2007]最大半连通子图 题目描述 一个有向图G=(V,E)称为半连通的(Semi-Connected),如果满足:?u,v∈V,满足u→v或v→u,即对于图中任意两点u,v,存在一条u到v ...