Can't kill a python process in sublime text 2

后端 未结 9 1018
难免孤独
难免孤独 2021-02-04 14:06

I\'ve searched in a lot of places but I can\'t seem to get the keywords correct. I have a stalling process in Python in Sublime that causes the beachball of death on a Mac. I ca

相关标签:
9条回答
  • 2021-02-04 14:28

    In SublimeText3, there is a keyboard shortcut for Tools > Cancel Build: ^C. If you click down in the build log and then enter control+C, it will stop the build with the message [Cancelled].

    0 讨论(0)
  • 2021-02-04 14:29

    I had the same issue and I just needed to handle the SIGTERM signal in my program coming from Sublime Text.

    import sys, signal
    
    def signal_handler(signal, frame):
        sys.exit(0)
    
    signal.signal(signal.SIGTERM, signal_handler)
    

    There is also a bug related to this, if you start new build when the old one is still running, it only terminates the process when you print something to terminal: https://github.com/SublimeTextIssues/Core/issues/1049

    0 讨论(0)
  • 2021-02-04 14:34

    This answer is specific to python and windows. I am not sure if there is a mac equivalent.

    A running python script can be terminated from the task manager. Use Ctrl+Shift+esc to open the Task Manager. Go to the processes tab and kill python.exe by simply pessing del. This would only terminate the script and leave sublime untouched.

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