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?
Can I configure IDLE to automatically convert tabs to spaces?
Asked Answered
IDLE isn't much of an IDE. –
Sanitize
IDLE isn't much of an IDE, AND it already prefers spaces over tabs. Just press your tab key and IDLE will add spaces. I don't think it's even possible to change it to support tabs. –
Idiocrasy
Did you check? This is trivial to verify. –
Disraeli
@Sanitize Why do you write that IDLE isn't an IDE ? (or maybe I don't understand the english expression "isn't much of"). See here (docs.python.org/2/library/idle.html): "IDLE is the Python IDE built with the tkinter GUI toolkit." –
Fabliau
Markus, same interrogation for you (I couldn't put @Markus Meskanen after @Blender) –
Fabliau
@Fabliau "IDLE isn't much of and IDE." means that IDLE sure is an IDE, but it's not a good one. IDLE barely fulfills the requirements of an IDE and there are so many things that it lacks from a modern IDE. –
Idiocrasy
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.
Downvoted for "get a real IDE". There is a place for IDLE, and better places to start editor wars. –
Sherman
Unfortunately IDLE does not have this functionality. I recommend you check out IdleX, which is an improved IDLE with tons of added functionality.
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? –
Legendre © 2022 - 2024 — McMap. All rights reserved.