0

我在 python 和 Rhino 中使用子进程执行多个脚本时遇到问题。我想导入 dxf/xyz 文件,重命名图层并拆分对象。这 3 个脚本单独工作,但是当通过子进程执行时,bbox-splitting 脚本在重命名图层完成之前开始运行,因此无法正常工作。知道如何在开始下一个脚本之前等待每个脚本完成吗?

script_call_dxf = "_-RunPythonScript {} ".format(dxf_script_path)       
script_call_xyz = "_-RunPythonScript {} ".format(xyz_script_path)
script_call_bbox = "_-RunPythonScript {} ".format(bbox_script_path)

call_script = '"{0}" /nosplash /runscript="{1} {2} {3}", "{4}"'.format(rhino_path, script_call_xyz, script_call_dxf, script_call_bbox, rhino_file)

subprocess.run(call_script)
4

0 回答 0