除了pylint工具可以扫描代码不符合规范之处外,也有软件包可以自动对代码格式进行修改。
自动将代码转换为pep8格式的python库autopep8,使用教程参考博客:Pycharm配置autopep8:自动调整代码为PEP8风格,in short:
安装:
pip install autopep8
使用:
autopep8 --in-place --aggressive <filename>
pip install pylint flake8 autopep8
autopep8 --in-place --max-line-length 120
clear;flake8 --ignore=E501 python/
clear;pylint --disable C0301 python/
sublime text pep8插件
https://bitbucket.org/StephaneBunel/pythonpep8autoformat/src/default/