我想同时从一个master script
. 这些脚本中的每一个都已经在其中包含并行运行的线程。例如我跑
脚本1.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()
脚本2.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()
我正在单独运行script1.py
它 script2.py
。唯一的区别是我传递给班级的参数。是否有可能有一个主脚本,如果我只运行它,这两个脚本都会运行?
谢谢