Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 520
karl_TUM Avatar asked Jun 09 '16 08:06

karl_TUM


People also ask

How do you indent lines on a Spyder?

If you haven't changed your settings* in Spyder, it will insert 4 spaces when you press the tab key. Spyder 4 will allow you to mark indentation levels with vertical lines.

How do you indent a block of code?

How do I indent a block of code? You (these are the default settings I believe) can select a block of code and press the Tab key. This will indent the entire block. So for indenting a whole file: Ctrl + A , then Tab .

Does Spyder have auto indentation?

Smart auto-indentation based on code structure.


1 Answers

Select your code and press Tab for indent and Shift+Tab to un-indent.

or go to Edit -> Indent/Unindent

Edit section also contains some other tools for editing your code.

like image 87
VDV Avatar answered Sep 19 '22 04:09

VDV