I'm making a python script (start.py) to run multiple (4) python scripts. My code:
import subprocess
from time import sleep
y=(0.2)
sleep (y)
subprocess.Popen(["python", 'a1.py'])
sleep (y)
subprocess.Popen(["python", 'a2.py'])
sleep (y)
subprocess.Popen(["python", 'a3.py'])
sleep (y)
subprocess.Popen(["python", 'a4.py'])
When I run start.py the four scripts run in background as I expected, but each one with a process ID. Is it possible to have one PID for all?
And how can I make the start.py
run at startup as a service? (i'm using raspberry pi).