Stop Sublime Text from executing infinite loop

前端 未结 7 1794
不知归路
不知归路 2020-12-28 15:36

When I do something like

while True:
    print(\'loop\')

and execute that code in sublime I am not able to stop it. I have to manually kill

7条回答
  •  时光取名叫无心
    2020-12-28 15:48

    Just follow this in case you are using Sublime Text 3, go to Preferences > Package Settings > Alignment > Key Bindings-User

    [
        { "keys": ["ctrl+n"], "command": "cancel_build" }
    ]
    

    Now, by pressing ctrl+n, the execution will immediately stop. Of course, you can change the combination to whatever you want (In place of ctrl+n).

提交回复
热议问题