I am using the Spyder editor for Python. I need to change the indentation setting (e.g., let "tab" mean "4 spaces").
How do I accomplish this?
In Spyder v3. 0.0, go to Source --> Fix Indentation. That worked for me.
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.
Use the reindent.py script that you find in the Tools/scripts/ directory of your Python installation: Change Python (. py) files to use 4-space indents and no hard tab characters. Also trim excess spaces and tabs from ends of lines, and remove empty lines at the end of files.
Spyder v. 4.0 or higher:
Tools >>> Preferences >>> Editor >>> Source code >>> Indentation characters
Other versions:
Tools >>> Preferences >>> Editor >>> Advanced settings >>> Indentation characters
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