This tutorial explains How to do Python Indentation in Notepad++.
Notepad++ is a simple editor, not a full-featured IDE, It will not do auto indentation by default.
First, You need to indent the first line manually, Notepad++ auto indents subsequent lines automatically.
Multiple ways we a do auto-indentation of Python code in Notepad++
- using plugin
- Settings
Settings
For the new and latest version
- Open Notepad++ Editor
- Go to
Settings
Menu - Select
Preferences
Item, Popup Window opened - Select the
Auto Completion
Tab, and Check theAuto indent
checkbox to do automatic indentation as per the below screenshot - Restart Notepad++
Another way, if the above option is not shown for older versions, please follow the below steps
- Go to
Settings
Menu - Select
Preferences
Item, Popup Window opened - Select the
MISC
Tab, check the Auto Indent checkbox - Restart Notepad++
Python plugin to auto-indent
- Select
plugins
Menu, SelectPlugin Admin
- Search
Python
and select thePython indent
plugin as given below - Click the Install button to install the plugin
- Once installed, next enable it
- Select the
Plugins
Menu, Select thePython Indent
item, and CheckEnable
option - Restart Notepad++