Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I configure IDLE to automatically convert tabs to spaces?

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?

like image 363
Nathan2055 Avatar asked May 14 '13 15:05

Nathan2055


2 Answers

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.

like image 124
Henry Keiter Avatar answered Oct 05 '22 17:10

Henry Keiter


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

like image 40
Lanaru Avatar answered Oct 05 '22 17:10

Lanaru