How to remove tab indent from several lines in IDL

2019-03-09 21:11发布

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.

7条回答
Deceive 欺骗
2楼-- · 2019-03-09 21:12

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+["

查看更多
我想做一个坏孩纸
3楼-- · 2019-03-09 21:20

Depends on your editor.

Have you tried Shift+Tab?

查看更多
倾城 Initia
4楼-- · 2019-03-09 21:21

in pythonwin,

SHIFT + TAB works

查看更多
萌系小妹纸
5楼-- · 2019-03-09 21:22
Shift-Tab
Ctrl-Tab
< key

depends on your editor.

查看更多
We Are One
6楼-- · 2019-03-09 21:25

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

查看更多
Emotional °昔
7楼-- · 2019-03-09 21:35

If you're using IDLE, and the Norwegian keyboard makes Ctrl-[ a problem, you can change the key.

  1. Go Options->Configure IDLE.
  2. Click the Keys tab.
  3. If necessary, click Save as New Custom Key Set.
  4. With your custom key set, find "dedent-region" in the list.
  5. Click Get New Keys for Selection.
  6. etc

I tried putting in shift-Tab and that worked nicely.

查看更多
登录 后发表回答