Python threading, threads do not close

后端 未结 3 1490
情话喂你
情话喂你 2020-12-20 23:12

I have a Python program and when I exit the application with Ctrl-c, the script does not close. My process still shows in running processes.

#!/         


        
3条回答
  •  独厮守ぢ
    2020-12-20 23:20

    I was unable to kill my python sub process because I had set the shell=True option in the process.Popen command. I removed shell=True and then I could kill it.

    If the subprocess is a shell, then you will have to kill the things it is running before the shell will end itself.

提交回复
热议问题