Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 5938

Subprocess.run multiple scripts - wait for each script to finish

$
0
0

Hello
I have a problem executing multiple scripts with subprocess in python. I want to import dxf/xyz files, rename layers and split the objects. The 3 scripts work individually but when executed via subprocess, the script for bbox-splitting starts running before renaming the layers has finished, hence isn’t working properly. Any idea how to wait for each script to finish before starting the next one?

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)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 5938

Trending Articles