我想用python并行生成一些文件。 Python将生成命令作为新的子进程调用。到目前为止,这些子过程与文件一样得到了创建。从子进程调用返回
我注意到,在最后一道工序结束时,预计会有回车。按Enter键完成最后一道工序。
如果我用os.system(commandString)同步(即按顺序)运行文件生成,则不需要CR。最后的过程是否以某种方式等待某件事?
谢谢你的帮助!
米哈伊
import subprocess
for trace in traces:
... # build commandString containing the in- and output filename
from subprocess import Popen
p = Popen(commandString)
'check_call'将等待并确保您获得0退出状态 – 2015-02-24 16:14:21