我有一个主要脚本,它按某种顺序运行其他几个程序(以避免手动启动它们)。因此,我使用线程来调用它们。 第一个是Windows应用程序,我这样称呼它:
class Nepthread(threading.Thread):
def run(self):
subprocess.call('PATH_TO_PRGM.exe')
pass
#...
nepthread = Nepthread()
nepthread.daemon = True
nepthread.start()
然后我以相同的方式运行Python脚本:
class UsbCameraThread(threading.Thread):
def run(self):
subprocess.call(["python",'PATH\\USBcamera.py'])
pass
#...
usbCameraThread = UsbCameraThread()
usbCameraThread.daemon = True
usbCameraThread.start()
但是对于这个,我需要等待它启动之后再运行下一个脚本。 当USBcamera脚本准备就绪时,它将在cout上写一些东西,然后开始无限循环:
print('Start Video recording!')
while True:
我的问题是:如何获取命令行输出以了解脚本是否已启动?
提前谢谢! 黑暗之味