简体   繁体   中英

Adding indentation to multiple lines at once in Python's IDLE

I have written many lines of code already, and have now changed my mind on their indentation. (I want to put all of these lines into a 'while' loop.)

For each line, I could press the space button or tab, but this would take a long time.

Can I add the appropriate indentation/margin to all these lines at once?

In Sublime Text , highlight text and press TAB (or SHIFT + TAB to do the opposite ie remove one level of indentation). This will do the same as adding a tab at the beginning of every line.

These shortcuts is the same in several other text editors, eg Notepad++, Eclipse and even Word.

Other editors may use different/additional shortcuts eg in CTL + ] or CTL + [ ) in IDLE (and Sublime Text).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM