1.PEP 8: W292 no newline at end of file
解决:在文件末尾加换行符(按回车即可)
Python PEP8 代码规范问题记录
PEP 8: no newline at end of file 代码末尾需要另起一行
PEP 8: indentation is not a multiple of four 缩进不是4的倍数,检查缩进
PEP 8: over-indented 过度缩进,检查缩进
PEP 8: missing whitespace after’,’ 逗号后缺少空格
PEP 8: multiple imports on one line 不要在一行 import 中引用多个库
PEP 8: blank line at end of line 删除代码末尾的空格
PEP 8: at least two spaces before inline comment 代码与注释之间至少有两个空格
PEP 8: block comment should start with ‘#’ 注释要以#加一个空格开始
PEP 8: inline comment should start with ‘#’ 注释要以#加一个空格开始
PEP 8: module level import not at top of file import 不在文件的顶部
PEP 8: expected 2 blank lines,found 0 需要两条空行
PEP 8: function name should be lowercase 函数名应该是小写字母
PEP 8: missing whitespace around operator 操作符 ( ' = '、' > '、' < ' 等 ) 前后缺少空格
PEP 8: E305 expected 2 blank lines after class or function definition, found 1 在类的定义以及函数定义之后需要空两行
PEP 8: E722 do not use bare 'except' 在捕获异常时,请尽可能的提及特定的异常,而不要使用裸except:
子句。
其他
每行尽量不要超过80个字符,如果超过,可以用小括号“()”将多行内容隐式连接。(过长的url除外)
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。