【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: E305 expected 2 blank lines after class or function definiti )

简介: 【错误记录】PyCharm 运行 Python 程序报错 ( PEP 8: E305 expected 2 blank lines after class or function definiti )

文章目录

一、报错信息

二、解决方案





一、报错信息


第一次写 Python 代码 , 报错如下 :


PEP 8: E305 expected 2 blank lines after class or function definition, found 1


image.png









二、解决方案


PEP 8: E305 expected 2 blank lines after class or function definition, found 1 在类和方法后面留出 2 22 行空行 , 当前只有 1 11 行 ;


在每个方法前留出 2 22 行空行 , 报错消失 ;

image.png


目录
相关文章
|
3月前
|
Web App开发 Python
Python使用selenium的Chrome下载文件报错解决
Python使用selenium的Chrome下载文件报错解决
49 0
|
2月前
|
安全 网络安全 API
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
74 1
python调用openai api报错self._sslobj.do_handshake()OSError: [Errno 0] Error
|
8天前
|
Python
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
IDA3.12版本的python,依旧报错IDAPython: error executing init.py.No module named ‘impRefer to the message win
|
1月前
|
索引 Python
Python程序报错合集
Python程序报错合集
14 0
|
1月前
|
文字识别 Python
python代码运行报错:No module named 'aliyunsdkcore'
用python调用阿里云图片OCR识别,使用的是阿里云官方给的传本地图片文件进行检测的代码,运行报错:No module named 'aliyunsdkcore'。在pycharm python软件包和终端里安装aliyunsdkcore这个模块都失败了。
|
1月前
|
vr&ar
运行nvue 页面报错reportJSException >>>> exception function:GraphicActionAddElement, exception:You ar...
运行nvue 页面报错reportJSException >>>> exception function:GraphicActionAddElement, exception:You ar...
20 0
|
2月前
|
Python
Pycharm没有报错提示(误触ignore)的解决方案
Pycharm没有报错提示(误触ignore)的解决方案
74 0
|
3月前
|
编解码 Python Windows
Python写入文件报错‘gbk’ codec can’t encode character的解决办法
Python写入文件报错‘gbk’ codec can’t encode character的解决办法
69 2
|
22天前
|
资源调度 Serverless 计算机视觉
高斯函数 Gaussian Function
**高斯函数,或称正态分布,以数学家高斯命名,具有钟形曲线特征。关键参数包括期望值μ(决定分布中心)和标准差σ(影响分布的宽度)。当μ=0且σ²=1时,分布为标准正态分布。高斯函数广泛应用于统计学、信号处理和图像处理,如高斯滤波器用于图像模糊。其概率密度函数为e^(-x²/2σ²),积分结果为误差函数。在编程中,高斯函数常用于创建二维权重矩阵进行图像的加权平均,实现模糊效果。
14 1
|
1月前
|
算法 Serverless C语言
CMake函数和宏(function和macro):使用函数和宏提高代码可读性
CMake函数和宏(function和macro):使用函数和宏提高代码可读性
30 1