Code: Select all
import os
import signal
import subprocess
import sys
import time
proc = subprocess.Popen(['fbi', '-a', '-T', '2', 'images/ready.png'])
print proc.pid
time.sleep(10)
proc.kill()
When the time.sleep is present then the pid after the program finishes is 1 higher than the pid printed from this script and it is not killed properly.
I want to be able to kill the process after some other code has run.