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.

函数命名问题

相关推荐
人工智能训练1 小时前
【极速部署】Ubuntu24.04+CUDA13.0 玩转 VLLM 0.15.0:预编译 Wheel 包 GPU 版安装全攻略
运维·前端·人工智能·python·ai编程·cuda·vllm
yaoming1681 小时前
python性能优化方案研究
python·性能优化
码云数智-大飞2 小时前
使用 Python 高效提取 PDF 中的表格数据并导出为 TXT 或 Excel
python
VernonJsn2 小时前
visual studio 2022的windows驱动开发
ide·驱动开发·visual studio
阿尔帕兹2 小时前
Visual Studio2019/2022离线安装完整教程(含闪退解决方法)
ide·visual studio
萌止3 小时前
Visual Studio下载保姆级安装教程
ide·visual studio
GISer_Jing3 小时前
解决Visual Studio调试时找不到exe文件的终极指南
ide·visual studio
程序人生5183 小时前
Visual Studio 2026下载与安装详细教程!(附下载地址)
ide·visualstudio·visual studio
biuyyyxxx3 小时前
Python自动化办公学习笔记(一) 工具安装&教程
笔记·python·学习·自动化
极客数模3 小时前
【2026美赛赛题初步翻译F题】2026_ICM_Problem_F
大数据·c语言·python·数学建模·matlab