如何在 IDLE 中删除多行制表符缩进?

发布于 2024-07-18 05:02:40 字数 95 浏览 6 评论 0原文

如果您想在 Python IDLE 中缩进多行,只需标记这些行并按 Tab 键即可。 但是,如果您想删除多行中的缩进怎么办? Shift+Tab 在 IDLE 中不起作用。

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.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

開玄 2024-07-25 05:02:40

如果您使用的是 IDLE,则可以使用 Ctrl+] 缩进,使用 Ctrl+[ 取消缩进。

If you're using IDLE, you can use Ctrl+] to indent and Ctrl+[ to unindent.

笑梦风尘 2024-07-25 05:02:40

如果您使用的是 IDLE,并且挪威语键盘使 Ctrl-[ 出现问题,您可以更改键。

  1. 转到“选项”->“配置 IDLE”。
  2. 单击“键”选项卡。
  3. 如有必要,请单击另存为新的自定义键集。
  4. 使用您的自定义键集,在列表中找到“dedent-region”。
  5. 单击“获取新选择密钥”。
  6. 等等

我尝试放入shift-Tab并且效果很好。

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.

ゝ偶尔ゞ 2024-07-25 05:02:40

取决于你的编辑器。

您尝试过 Shift+Tab 吗?

Depends on your editor.

Have you tried Shift+Tab?

暮年慕年 2024-07-25 05:02:40

在 pythonwin 中,

SHIFT + TAB 有效

in pythonwin,

SHIFT + TAB works

忆梦 2024-07-25 05:02:40

对于 IDLE,选择行,然后打开“格式”菜单。 (如果您找不到它,则在“编辑”和“运行”之间。)这也会为您提供键盘快捷键,对我来说,缩进快捷键是“Ctrl+[”

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

秋心╮凉 2024-07-25 05:02:40
Shift-Tab
Ctrl-Tab
< key

取决于你的编辑。

Shift-Tab
Ctrl-Tab
< key

depends on your editor.

憧憬巴黎街头的黎明 2024-07-25 05:02:40

在 Jupyter 笔记本中,

 SHIFT+ TAB(to move left) and TAB(to move right) movement is perfectly working.

In Jupyter Notebook,

 SHIFT+ TAB(to move left) and TAB(to move right) movement is perfectly working.
相思故 2024-07-25 05:02:40

默认情况下,IDLE 将其放在 Shift-左括号中。 但是,如果您愿意,可以通过单击选项 --> 将其自定义为 Shift-Tab。 配置IDLE --> 按键 --> 使用自定义按键集 --> 缩进区域 --> 获取新的选择键

然后您可以选择您想要的任何组合。 (不要忘记单击“应用”,否则所有设置都不会受到影响。)

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文