Search code examples
pythonindentationpython-idle

How do I unindent blocks of code in Python?


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.


Solution

  • 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.