开发者

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).

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜