I am using spyder IDE for python coding. I copied the code from some source,it works fine. But when I make edits in it indentation error occurs. There is always some mistake in the alignment of my edit and the other part of code. Code is quite large I can't re indent it.
Select your code and press Tab for indent and Shift + Tab to un-indent. Edit section also contains some other tools for editing your code.
Go to your code editor settings and enable the option that seeks to display tabs and whitespaces. With this feature enabled, you will see single small dots, where each dot represents a tab/white space. If you notice a drop is missing where it shouldn't be, then that line probably has an indentation error.
In Spyder v3. 0.0, go to Source --> Fix Indentation. That worked for me. Save this answer.
To view where Spyder has added the wrong formatting, go to Preferences > Editor and select; "show blank spaces" and "show indent guides". Delete the blank spaces and add indents. Job done.
In Spyder v3.0.0, go to Source --> Fix Indentation. That worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With