Can I configure IDLE to automatically convert tabs to spaces?

14,941

Solution 1

From the IDLE documentation:

Tab inserts 1-4 spaces (in the Python Shell window one tab).

You can also use Edit > Untabify Region to convert tabs to spaces (for instance if you copy/pasted some code into the edit window that uses tabs).


Of course, the best solution is to go download a real IDE. There are plenty of free editors that are much better at being an IDE than IDLE is. By this I mean that they're (IMO) more user-friendly, more customizable, and better at supporting all the things you'd want in a full-featured IDE.

Solution 2

Unfortunately IDLE does not have this functionality. I recommend you check out IdleX, which is an improved IDLE with tons of added functionality.

Share:
14,941
Nathan2055
Author by

Nathan2055

Software engineer and graduate of Georgia State University located in Georgia.

Updated on July 02, 2022

Comments

  • Nathan2055
    Nathan2055 almost 2 years

    I know that spaces are preferred over tabs in Python, so is there a way to easily convert tabs to spaces in IDLE or does it automatically do that?

  • Henry Keiter
    Henry Keiter almost 11 years
    IDLE behaves this way by default (at least in the edit window)... And the command Edit > Untabify Region converts tabs to spaces. What functionality don't you think it has?
  • trapicki
    trapicki about 4 years
    Downvoted for "get a real IDE". There is a place for IDLE, and better places to start editor wars.