Pycharm报的一些Python语法错误

Pycharm报的一些Python语法错误

1、PEP8:Expected 2 blank less:found 1

意思是:类和上面的行要间隔两行,现在只有一行

解决办法: 间隔2行

2、Remove redundant parentheses

意思是:删除多余的括号

解决:删掉外面括号即可

3、PEP8:whitespace before ':'

意思:语句和:不能有空格

解决:把空格删除

4、 PEP 8: blank line at end of file

意思:文件尾部没有新起一行

解决: 光标移到最后回车即可。

PEP 8 coding style violation 的告警ID查看 https://pep8.readthedocs.io/en/latest/intro.html#error-codes

PEP 8 naming convention violation 的告警ID查看 https://pypi.org/project/pep8-naming/

5、Function name should be lowercase less

Function name should be lowercase less... (Ctrl+F1)

Inspection info: This inspection checks the PEP8 naming conventions.

函数命名问题

相关推荐
曲幽2 小时前
FastAPI 身份验证总踩坑?这份 FastAPI Users “避坑指南”请收好
python·fastapi·web·jwt·oauth2·user·authentication
装不满的克莱因瓶2 小时前
掌握 RNN 与 LSTM 模型结构
人工智能·python·rnn·深度学习·神经网络·ai·lstm
何以解忧,唯有..3 小时前
Python包管理工具pip:从入门到精通
开发语言·python·pip
金銀銅鐵3 小时前
用 Tkinter 实现简单的猜数字游戏
后端·python
copyer_xyf3 小时前
Python 模块与包的导入导出
前端·后端·python
ice8130331814 小时前
【Python】Matplotlib折线图绘制
开发语言·python·matplotlib
copyer_xyf4 小时前
Python venv 虚拟环境
前端·后端·python
林爷万福5 小时前
GitHub 开源光谱数据处理项目推荐
python·光纤光谱仪
copyer_xyf5 小时前
Python 如何同时做很多事:进程、线程、协程
前端·后端·python
Full Stack Developme5 小时前
Spring Bean 依赖注入
python·spring·log4j