PEP8的规范:https://blog.csdn.net/u010429481/article/details/79891343
Python编程代码规范(Google Style)
https://blog.csdn.net/zong596568821xp/article/details/81162557
Python之代码规范管理工具
https://blog.csdn.net/zong596568821xp/article/details/84251616
python如何实现代码检查
https://www.jb51.net/article/164177.htm
play.py
from playsound import playsound
#print("1.mp3")
#
#playsound('1.mp3')
n = 1
while n:
musicname = input("pls input musice name:")
playsound(musicname)
n = n + 1
用pylint play.py检查得分:
E:\heqing\1-Pythonkid\test>pylint play.py
************* Module play
play.py:10:0: C0303: Trailing whitespace (trailing-whitespace)
play.py:11:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
play.py:12:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
play.py:13:0: W0311: Bad indentation. Found 2 spaces, expected 4 (bad-indentation)
play.py:1:0: C0114: Missing module docstring (missing-module-docstring)
play.py:8:0: C0103: Constant name "n" doesn't conform to UPPER_CASE naming style (invalid-name)
play.py:11:2: C0103: Constant name "musicname" doesn't conform to UPPER_CASE naming style (invalid-name)
play.py:13:2: C0103: Constant name "n" doesn't conform to UPPER_CASE naming style (invalid-name)
------------------------------------
Your code has been rated at -3.33/10
可怜的-3.33分
C——违反代码风格标准;
R——代码结构较差;
W——关于细节的警告;
E——代码中存在错误;
F——导致Pylint无法继续运行的错误。
参考文章:https://blog.csdn.net/sinat_38682860/article/details/102500606
使用方法:https://blog.csdn.net/weixin_36646275/article/details/83965622
可以对比一下先前的。
再用pylint测一下分数