批量延迟按顺序执行python

时间:2017-12-13 23:42:42

标签: python batch-file gis

我使用批处理文件在GIS环境之外执行重复/繁琐的GIS任务。我正在寻找提高性能的方法。一种简单的方法是当前并发运行的脚本并且不要相互依赖并行运行。我当前的批处理文件如下

c:\pathtopython c:\pathtopythonscript1
start c:\pathtopython c:\pathtopythonscript2a
start c:\pathtopython c:\pathtopythonscript2b
start c:\pathtopython c:\pathtopythonscript2c
start c:\pathtopython c:\pathtopythonscript2d
c:\pathtopython c:\pathtopythonscript3

运行时,它将运行第一个,然后在parrallel中启动并运行4个版本的2但无法运行脚本3.我想知道是否有办法延迟脚本3的运行,直到所有版本的脚本2都已完成。

1 个答案:

答案 0 :(得分:0)

是的,您可以运行第二个块,并按照此answer中@Aacini的描述进行等待。

c:\pathtopython c:\pathtopythonscript1
(
start c:\pathtopython c:\pathtopythonscript2a
start c:\pathtopython c:\pathtopythonscript2b
start c:\pathtopython c:\pathtopythonscript2c
start c:\pathtopython c:\pathtopythonscript2d
) | set /P "="
c:\pathtopython c:\pathtopythonscript3
相关问题