开发者

python: executing "start /wait someprocess"

开发者 https://www.devze.com 2023-03-22 23:47 出处:网络
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 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

精彩评论

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