Website content quality is poor, distribution efficiency is too low how to do?Huawei engineers offer 5 unique skills>>>
Pycharm configures autopep8 to format Python code automatically
1. About PEP 8
PEP 8, style guide for Python code, is the official coding convention of python, mainly to ensure the consistent style of Python coding and improve the readability of code
Official website address: https://www.python.org/dev/peps/pep-0008/
2. About autopep8
Autopep8 is a tool that automatically formats Python code to conform to the style of PEP 8. It uses the pycodestyle tool to determine which parts of the code need to be formatted. Autopep8 can fix most of the format problems detected by pycodestyle
GitHub address: https://github.com/hhatto/autopep8
3. Download and install autopep8
pip installautopep8
4. Use autopep8
The command line is used as follows
$autopep8 — in place — aggressive — aggressive file name
5. How to configure autopep8 with pcharm
1) Select the menu “file” – > ” Settings」–>「 Tools」–>「 External Tools」–> Click the plus sign to add a tool
2) Fill in the following configuration items and click OK to save
Name: autopep8 (optional)
Tools settings:
Programs:autopep8
Parameters:–in-place –aggressive –ignore=E123,E133,E50 $FilePath$
Working directory:$ProjectFileDir$
3) Select the menu “tool” – > ” Extern Tools」–>「 Autopep8 “can use autopep8 to format your Python code automatically
Similar Posts:
- IntelliJ IDEA: Clone failed runnerw.exe CreateProcess failed with error 2
- How to Solve MSB8020 The build tools for v141 (Platform Toolset = ‘v141‘) cannot be found. To build using the
- OS Error: No address associated with hostname, errno = 7 [How to Solve]
- Pychar error report solution: error:please select A valid Python interpreter and some basic settings
- [Solved] yarn Install Module Error:check python checking for Python executable “python2” in the PATH
- Solutions to axis RP extension for chrome problems
- Git Upload File Error: fatal: could not read from remote repository. [How to Solve]
- Git push submit error 403, processing method
- Python Error: Non-UTF-8 code starting with ‘\xe7’ [How to Solve]
- Win7 & win10 install ad management tool