Python Basic Autopep8__python Code specification

Source: Internet
Author: User

About PEP 8

PEP 8,style Guide for Python code, is the official Python coding convention, mainly to ensure that the Python coding style consistent, improve the readability of the code.

Website address: https://www.python.org/dev/peps/pep-0008/

About AUTOPEP8

AUTOPEP8 is a tool that automatically formats Python code to conform to THE PEP 8 style. It uses the Pycodestyle tool to determine which parts of the code need to be formatted. AUTOPEP8 can fix most of the formatting problems of pycodestyle detection.

GitHub Address: HTTPS://GITHUB.COM/HHATTO/AUTOPEP8

Installation:

Pip Install Autopep8

Use the command:

AUTOPEP8--in-place--aggressive--aggressive <filename>

Parameter description:

&GT;USAGE:AUTOPEP8 [-h] [--version] [-v] [-d] [-i] [--Global-config filename]> [--ignore-local-config] [-r] [-j n] [-P n] [-A]> [--experimental] [--exclude globs] [--list-fixes]> [--ignore errors] [--select errors] [--max-line-length n]> [--line-range Line line]>[files [files ...]]> > Automatically formats Python code to conform to the PEP 8style guide.> >positional arguments:> Files Files to formator '-'  forStandardinch> >Optional arguments:>-H,--help show this help message andExit>--version Show Program'S version number and exit>-V,--verbosePrintverbose messages; Multiple-v resultinch More>Verbose Messages>-D,--diffPrintThe diff forThe fixed source>-I.,--inch-place make changes to filesinch Place>--Global-config filename> Path to aGlobalPep8 config file;ifThis file does> notexist then this isignored (default:> ~/.config/PEP8)>--ignore-local-Config> Don'T look for and apply local config files;> passed, defaults is updated with any config filesinch> The Project's root directory>-R,--recursive run recursively over directories; must is used with>--inch-placeor--diff>-j N,--jobs n number of parallel jobs; Match CPU CountifValue is> Less than 1>-P N,--pep8-Passes N>Maximum number of additional PEP8 passes (default:>infinite)>-A,--aggressive enable non-whitespace changes; Multiple-a resultinch>More Aggressive Changes>--Experimental enable experimental fixes>--exclude globs exclude file/directory names that match these comma->separated globs>--list-fixes list Codes forFixes Used by--ignore and--Select>--ignore errors Do notFix these errors/warnings (DEFAULT:E24)>--select errors fix only these errors/warnings (e.g. e4,w)>--max-line-length n Set maximum allowed line length (default:79)>--line-range Line,--Range Line line>Only fix errors found within this inclusive range of> line numbers (e.g. 1 99); Line numbers is indexed at

 

Python Basic Autopep8__python Code specification

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.