Autopep8安裝配置


python編碼規范:

PEP8(英文原文)https://www.python.org/dev/peps/pep-0008/

         (中文原文)https://wiki.woodpecker.org.cn/moin/PythonCodingRule

 

python中提供了tool Autopep8自動將Python代碼格式化為符合PEP 8。

今天安裝網上的文檔配置了下,使用時報“error = 2,No such file or directory”。查了下是aotopep8配置的有問題。這里記錄下。

 

安裝:

在pycharm中File->Setting->Project: test->Project Interpreter

點擊 “+”,搜索autopep8,install package,安裝完成后,點擊ok

 配置:

在pycharm中File->Setting->Tools->External Tools

點擊“+”

彈窗中填入幾個參數:

Name:自己定義,一般用autopep8

Program:autopep8安裝的路徑

Arguments:--in-place --aggressive $FilePath$

Working directory:$ProjectFileDir$

點擊ok,ok

 

 

 使用:選擇要調整的python文件,右擊,External Tools->autopep8


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM