py code formatter

最後更新: 2022-08-18

Formatter

 


autopep8

 

Install by PIP

pip install autopep8

Install on Centos7

# 因為 pip 太舊, 不應一鍵安裝了

yum install configparser python2-pycodestyle python2-pip

pip install autopep8

Usage

autopep8 your_script.py    # dry-run, only print

autopep8 -i your_script.py # replace content

 

 


yapf

 

pip install yapf

yapf your_script.py    # dry-run, only print

yapf -i your_script.py # replace content

 


isort

 

pip install isort

 

 

Creative Commons license icon Creative Commons license icon