Search code examples
pythonpycharmspyderpep8autoformatting

config Spyder or Pycharm to comply with the PEP8 style standards


I use spyder to code python. Could you guide me to set up spyder or Pycharm or config to comply with the PEP8 style standards, autoformat.


Solution

  • PyCharm 2.7 takes care of readability and general beauty of your code.

    Now it supports continuous checking of your code for PEP 8 compliance on the fly, as you type it in the editor. PyCharm highlights any coding style violations and gives you suggestions, which you can apply instantly with the well known PyCharm quick-fixes (PEP8 guidline is to be found here)

    Autoformat Code:

    To reformat code for the current file, follow these steps: In the editor of the currently opened file, press Ctrl+Shift+Alt+L . Note that if you select Code. Reformat Code from the main menu or press Ctrl+Alt+L , PyCharm will try to reformat the source code automatically without opening the Reformat File dialog.