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 m开发者_Python百科yprogram
?
I've tried subprocess.call(['start', '/wait', 'myprogram.exe'])
but it can't find start
and neither can I.
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).
精彩评论