Changing indentation in Python's IDLE

倖福魔咒の 提交于 2020-01-06 06:56:07

问题


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?


回答1:


In Sublime Text, highlight text and press TAB (or SHIFT+TAB to do the opposite i.e. 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, e.g. Notepad++, Eclipse and even Word.

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



来源:https://stackoverflow.com/questions/12193991/changing-indentation-in-pythons-idle

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!