Stop Sublime Text from executing infinite loop

前端 未结 7 1752
不知归路
不知归路 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 16:11

    You want to use Ctrl+Break. For your own information, just go check under Tools in Sublime Text and you'll see Cancel Build and the above hotkey. It'll work just fine for infinite loops. Suffice to say, I've had the same happen! ;)


    For Windows users, there is no Break key, so go into Preferences>Key Bindings and change the line

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

    to a different shortcut, such as Ctrl+Alt+B

    0 讨论(0)
提交回复
热议问题