如何在 Python IDE: Spyder 中缩进代码块?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/37721263/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-19 19:51:19  来源:igfitidea点击:

how to indent the code block in Python IDE: Spyder?

pythonipythonspyder

提问by karl_TUM

Is there any shortcut key in Spyder python IDE to indent the code block? For example, Like ctr+[in Matlab, I want to indent the code block together.

Spyder python IDE中有没有快捷键可以缩进代码块?例如,像ctr+[在 Matlab 中一样,我想将代码块缩进在一起。

回答by VDV

Select your code and press Tabfor indent and Shift + Tabto un-indent.

选择您的代码并按Tab缩进和Shift + Tab取消缩进。

or go to Edit -> Ident/Unident

或转到编辑 ->身份/身份

Edit sectionalso contains some other tools for editing your code.

编辑部分还包含一些其他用于编辑代码的工具。

回答by Deepesh ranjan

Spyder 4 select the lines and then press TAB or CTRL+]For indent and shift+TAB or CTRL+]for un-indent

Spyder 4 选择行,然后按TAB 或 CTRL+]用于缩进和shift+TAB 或 CTRL+]用于取消缩进