How do I unindent blocks of code in Python?

user5300247 picture user5300247 · Sep 22, 2015 · Viewed 34.1k times · Source

I am using Python 2.7.10 and am having trouble trying to unindent a block of code. Surely there is some sort of shortcut, instead of having to backspace every individual line?

From the Python Shell, I opened a new file (.py) and that's where I am writing the code.

Shift + Tab does not work.

Answer

Psytho picture Psytho · Sep 22, 2015

It is Ctrl + [ in IDLE. You can change it to your favorite Shift + Tab in Options -> Configure IDLE - Keys. You need to restart the shell after that.