Wait for subprocess.call completion before executing next line.

Asked by sdraganov on 2018-06-01

I'm running a suprocess.call command in the middle of my sikulix-script and realized that sikuli doesn't wait for subprocess completion, instead it interrupts it and continue executing the code bellow.

Adding a wait command does the trick but I am interested to know if there is a better way to handle this since it's not always easy to predict how much it it would take to finish subprocess, and adding excessive waiting time just to ensure suprocess pass successfully is not the option I am looking for.

Thanks in advance.

Question information

Language:
English Edit question
Status:
Solved
For:
Sikuli Edit question
Assignee:
No assignee Edit question
Solved by:
sdraganov
Solved:
2018-06-10
Last query:
2018-06-10
Last reply:
2018-06-02
sdraganov (sdraganov) said : #2

Thanks,

I think by default subprocess.call waits for the completion of the executed command before moving on. SikuliX didn't wait previous time but not it does. I'm not sure what happened but if it happen again I'll try to figure it out why.