批处理延迟按顺序辩护Python



我使用批处理文件在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

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

是的,您可以运行第二个块,并在此答案中按照@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

最新更新