Skip to content

Instantly share code, notes, and snippets.

@y56
Created November 26, 2019 01:52
Show Gist options
  • Save y56/e0dc67f4b5aae7a9b3e995ccc263700e to your computer and use it in GitHub Desktop.
Save y56/e0dc67f4b5aae7a9b3e995ccc263700e to your computer and use it in GitHub Desktop.
autopep8
The program autopep8 can be used to automatically reformat code in the PEP 8 style. Install the program with:
$ pip install autopep8
Use it to format a file in-place with:
$ autopep8 --in-place optparse.py
Excluding the --in-place flag will cause the program to output the modified code directly to the console for review. The --aggressive flag will perform more substantial changes and can be applied multiple times for greater effect.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment