Reputation: 1
I'm actually running a subprocess from a python program using Popen
proc= subprocess.Popen("xterm -e python script.py", shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
And when this process is running on xterm, we can kill it using Ctrl+C
, is there a way to send other signals using (Ctrl+Z
and fg
,...) to resume and continue the job?
Another solution would be running this process in another terminal, without using xterm -e
is this possible?
Any other solution would be helpful.
Thanks
Upvotes: 0
Views: 1018
Reputation: 17306
You could do it programatically in psutil
import psutil
p = psutil.Pocesss(proc.pid)
p.suspend()
p.resume()
Upvotes: 1