2

I've see many posts where ctrl-c supposedly kills a subprocess.

However I have the opposite problem. In my code I have following line:

p = subprocess.Popen(["python3", script_file])

Now when I type ctrl-C randomly in Python console, this subprocess will exit. I dont't want this to happen. Is there a way to make sure it doesn't happen?

bumpbump
  • 542
  • 4
  • 17
  • 2
    Does this answer your question? [Python: How to prevent subprocesses from receiving CTRL-C / Control-C / SIGINT](https://stackoverflow.com/questions/5045771/python-how-to-prevent-subprocesses-from-receiving-ctrl-c-control-c-sigint) – sj95126 Oct 25 '22 at 01:30
  • One option is to run this process as a service. How that is done depends on the OS. – tdelaney Oct 25 '22 at 01:44

0 Answers0