I want to run two or more python scripts simultaneously from a master script
. Each of these scripts already have threads within them which are running in parallel. For example I run
script1.py
if __name__ == '__main__':
pid_vav = PID_VAV('B2')
t1 = threading.Thread(target=pid_vav.Controls)
t1.daemon = False
t1.start()
t2 = threading.Thread(target=pid_vav.mqttConnection)
t2.daemon = False
t2.start()
script2.py
if __name__ == '__main__':
pid_vav = PID_VAV('B4')
t1 = threading.Thread(target=pid_vav.Controls)
t1.daemon = False
t1.start()
t2 = threading.Thread(target=pid_vav.mqttConnection)
t2.daemon = False
t2.start()
I am running this script1.py
and script2.py
separately. Only difference is the parameter which I am passing to the class. Is it possible to have a master script such that if I just run that, both these scripts will run ?
Thanks