b.py
import subprocess
f = subprocess.Popen(['python', 'a.py'])
time.sleep(3000)
a.py
import time
time.sleep(1000)
Run python b.py, Press CTRL+C, both processes will terminate.
However send the signal SIGINT to the parent process b.py, kill -2 xxxx, but the child process a.py remains.
Ctrl+Cis similar toos.killpg(xxxx, signal.SIGTERM)here. - jfs