"PEP:8 expected 2 blank lines ,found 1"
pycharm shows "PEP:8 expected 2 blank lines ,found 1"
用pycharm写python的时候,总会在def function()
的那行出现如上问题。
解决办法:参考了【pycharm shows expected 2 blank lines ,found 1】
具体原因就是呢,在声明函数的那一行的上方必须有两行的空行,否则便出现这个情况。
函数的注释可随函数为一体,即,下面两种方法均可
# coding: utf-8
# fun1
def func1():
return 0
# fun2
def func2():
return 1
# coding: utf-8
# fun1
def func1():
return 0
# fun2
def func2():
return 1
"PEP:8 expected 2 blank lines ,found 1"的更多相关文章
- pycharm 出现 "PEP:8 expected 2 blank lines ,found 0"
https://blog.csdn.net/modangtian/article/details/79687623 这句话的意思是“有两个空白行,但是没有发现.” 在声明函数的那一行的上方必须有两行的 ...
- 二十九、pycharm中报错“too many blank lines (3) ”等类似错误
报错如下图: 解决方法一: 鼠标移至报错处,按住Alt+enter键,选择ignore errors like this 方法二:找到设置File - Settings…… - Editor - In ...
- Incorrect column count: expected 1, actual 5,JdbcTemplate queryForList 出错
spring JdbcTemplate queryForList 出错 Incorrect column count: expected 1, actual 5 >>>>&g ...
- Light OJ 1364 Expected Cards (期望dp,好题)
题目自己看吧,不想赘述. 参考链接:http://www.cnblogs.com/jianglangcaijin/archive/2013/01/02/2842389.html #include &l ...
- django中的null=true,blank=true,这个讲得清楚点
看mastering django:core,中文名<精通django>里的, 说得在理点. 截个图
- Python代码规范(PEP8)问题及解决
转载:https://blog.csdn.net/Jason_Lewis/article/details/75386598 最近刚刚接触Python,为了养成好习惯,尽量保证自己写的代码符合PEP8代 ...
- python PEP8代码规范及问题
最近刚刚接触Python,为了养成好习惯,尽量保证自己写的代码符合PEP8代码规范,下面是过程中报出的警告及解决方法,英文有些翻译不太准确见谅,会不断更新: PEP 8: module level i ...
- pycharm问题集锦
1.pycharm的激活方式 参考博客https://blog.csdn.net/u014044812/article/details/78727496 2.总是出现波浪线,如下问题 问题原因:knn ...
- Python代码规范问题及解决
Python代码规范问题及解决 为了养成使用Python编程好习惯,尽量保证自己写的代码符合PEP8代码规范,下面是过程中报出的警告及解决方法,英文有些翻译不太准确见谅,会不断更新: PEP 8 只是 ...
随机推荐
- 安装xenserver6.5
安装之前的准备工作就不在赘述了,下边开始安装 1.安装界面 2.键盘模式选择默认-美式,ok 3.这里提醒你安装将清除磁盘信息,做好备份,选择ok. 4.这一步没有选择,要么继续,要么退回,选择Acc ...
- ThreadLocal 从源码角度简单分析
目录 ThreadLcoal源码浅析 ThreadLocal的垃圾回收 Java引用 ThreadLocal的回收 各线程中threadLocalMap的回收 内存泄露问题 总结 参考 ThreadL ...
- ng2 quickstart
1.下载 git clone https://github.com/angular/quickstart.git quickstart-angular 2.安装模块 npm install 3.启动 ...
- Spring Cloud 坑点
1 配置中心 1.config 默认Git加载 通过spring.cloud.config.server.git.uri指定配置信息存储的git地址,比如:https://github.com/spr ...
- Struts2框架学习第三章——Struts2基础
本章要点 — Struts 1框架的基本知识 — 使用Struts 1框架开发Web应用 — WebWork框架的基本知识 — 使用WebWork框架开发Web应用 — 在Eclipse中整合To ...
- UWP C# 调用 C++/CX
创建一个UWP项目 然后创建一个通用C++运行时项目 右键点击C++项目,添加一个C++类 在头文件中定义一个类 #pragma once namespace ImageFactoryRT { pub ...
- 一个很有用的树形控件----zTree
演示地址 http://www.treejs.cn/v3/demo.php#_101
- nyoj115——裸dijksta(点之间最短路)
城市平乱 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 南将军统领着N个部队,这N个部队分别驻扎在N个不同的城市. 他在用这N个部队维护着M个城市的治安,这M个城市 ...
- net.paoding.analysis.exception.PaodingAnalysisException: dic home should not be a file, but a directory!
Caused by: net.paoding.analysis.exception.PaodingAnalysisException: dic home should not be a file, b ...
- 一道经典的面试题:如何从N个数中选出最大(小)的n个数
转载:https://zhidao.baidu.com/question/1893908497885440140.html 这个问题我前前后后考虑了有快一年了,也和不少人讨论过.据我得到的消息,Goo ...