Search code examples
python-idlepython-3.5auto-indent

How can I stop IDLE from auto indeting?


I've been coding in IDLE for a few days now. I have version 3.5.1 of python if that helps.

I was coding today and I noticed that when ever I start a new line it will be indented. It's quite annoying actually because most of the time I don't even need the code to be further indented and when I do it never puts the correct amount of space. It tends to be a tab and a space to far.

Is there any known method to prevent this?


Solution

  • There is not way to turn auto indent off. The Shell currently uses tabs because of the '>>> ' prompt (I hope to improve this someday). The editor uses spaces according to the configuration setting on the Options / Configure IDLE / Fonts/Tab tab. The default is now 4 spaces per tab. The smart indent is usually right according to PEP 8. 'Wrong indents' are usually a sign of a syntax error. IDLE indents according to what you write, not what you intend.