Reputation: 129
I have a GUI based program where I need the user to be able to pause or resume a subprocess. For example, if I have:
programID = subprocess.Popen("program_name"), shell=True)
Is there a way that I can pause or resume this? I read something about using SIGTERM but I didn't quite grasp it.
Upvotes: 2
Views: 3103
Reputation: 601401
To pause the process, use
os.kill(programID.pid, signal.SIGSTOP)
To resume execution, use
os.kill(programID.pid, signal.SIGCONT)
Upvotes: 8