除了pylint工具可以掃描代碼不符合規範之處外,也有軟件包可以自動對代碼格式進行修改。
自動將代碼轉換爲pep8格式的python庫autopep8,使用教程參考博客:Pycharm配置autopep8:自動調整代碼爲PEP8風格,in short:
安裝:
pip install autopep8
使用:
autopep8 --in-place --aggressive <filename>
sublime text pep8插件
https://bitbucket.org/StephaneBunel/pythonpep8autoformat/src/default/