Jason S
Jason S

Reputation: 189676

python: executing "start /wait someprocess"

I've used Python's subprocess.call() before, but how do you get it to act like the Windows START /WAIT myprogram?

I've tried subprocess.call(['start', '/wait', 'myprogram.exe']) but it can't find start and neither can I.

Upvotes: 0

Views: 166

Answers (1)

Cat Plus Plus
Cat Plus Plus

Reputation: 129764

If you want to wait for a spawned process, then use subprocess.Popen and then either wait or communicate. start is AFAIR a shell construct, not a real exec (so you'd have to use shell = True — but that still wouldn't do what you want).

Upvotes: 1

Related Questions