If you want to indent several lines in Python IDLE you just mark the lines and hit Tab. But what if you want to remove the indent from several lines? Shift+Tab does not work for that in IDLE.
If you're using IDLE, you can use Ctrl+] to indent and Ctrl+[ to unindent.
Every code editor worth its salt has a one-key way to indent and dedent blocks. In IDLE (the IDE included with Python), CTRL + [ dedents and CTRL + ] indents. Selecting text then using the shift+tab shortcut also works if you're using the Python editor built into Canopy on Windows.
Thanks for your help, it is Ctrl + [.
If you're using IDLE, you can use Ctrl+]
to indent and Ctrl+[
to unindent.
If you're using IDLE, and the Norwegian keyboard makes Ctrl-[ a problem, you can change the key.
I tried putting in shift-Tab and that worked nicely.
Depends on your editor.
Have you tried Shift+Tab?
in pythonwin,
SHIFT + TAB works
For IDLE, select the lines, then open the "Format" menu. (Between "Edit" and "Run" if you're having trouble finding it.) This will also give you the keyboard shortcut, for me it turned out that dedent shortcut was "Ctrl+["
Shift-Tab
Ctrl-Tab
< key
depends on your editor.
In Jupyter Notebook,
SHIFT+ TAB(to move left) and TAB(to move right) movement is perfectly working.
By default, IDLE has it on Shift-Left Bracket. However, if you want, you can customise it to be Shift-Tab by clicking Options --> Configure IDLE --> Keys --> Use a Custom Key Set --> dedent-region --> Get New Keys for Selection
Then you can choose whatever combination you want. (Don't forget to click apply otherwise all the settings would not get affected.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With