我正在用python编写一个脚本,它将运行一个批处理文件,批处理完成后将继续执行更多操作。在
我编写了执行批处理的代码,并等待它完成。问题是,如果批处理失败,脚本将不知道它。 如果批处理成功或失败,它将打印到控制台。 我需要您的帮助,以便了解如何使用脚本将批打印读取到控制台
以下是相关代码:
def runAutoFa(self):
process = Popen([self._batPath], cwd = path, stdin = PIPE)
process.stdin.write(self._commit)
time.sleep(2)
process.stdin.write(self._product)
time.sleep(2)
process.stdin.write(self._setupName)
time.sleep(2)
process.stdin.close()
status = process.wait() # The command waits until the batch is finised
self._logger.flush()
return status
在继续脚本之前,我需要能够在等待批处理完成的同时读取打印
谢谢!在
目前没有回答
相关问题 更多 >
编程相关推荐