Notepad++ indentation messes up

前端 未结 6 682
灰色年华
灰色年华 2020-11-30 01:55

I\'m coding in Python and I really like Notepad++. However, off late when I use tab to indent, it seems fine in Notepad++, but when I run the program I get an indentation er

6条回答
  •  臣服心动
    2020-11-30 02:22

    Use Python Indent Plugin for Notepad++: I have used both Pycharm & Notepad++, and frankly - even though both are installed on my machine right now I prefer using Notepad++. So, if you want to continue using Notepad++ for Python development you should definitely install the 'Python Indent' Plugin. This plugin will automatically create tabs for you when writing Python code. The only downside to the plugin is you have to remember to Enable it (by going to Plugins --> Python Indent and then clicking 'Enable') when you want to use it.

    To install the Python Indent plugin in Notepad++ just go to 'Plugins' --> 'Plugin Manager' and then click on 'Show Plugin Manager'. Then check off 'Python Indent' and click on the 'Install' button.

    Additionally, you should Follow Python's Usage Guide: Tab spacing can differ across programs and, following the recommendations of PEP8 (Python Enhancement Proposals Number 8 - which is Python's Accepted Styling and Usage Guide) you should use the space bar to make your indents. Check out the PEP8 Page about spacing here: https://www.python.org/dev/peps/pep-0008/#tabs-or-spaces

    Good luck!

提交回复
热议问题