可能重複:
how to call a program from python without waiting for it to return開始在Python外部程序,並立即返回
我正在寫的啓動需要一個外部的Windows可執行一個PyQt的程序。此時,Python程序應該繼續運行,從不需要與啓動的exe文件進行任何接觸。
我嘗試了好幾種變體,如:
process = subprocess.Popen(["vncviewer.exe"]); process.communicate()
subprocess.call("vncviewer.exe")
os.system("vncviewer.exe")
os.system("vncviewer.exe&")
os.system("start vncviewer.exe")
等
使用最多的任何策略,我能成功運行的程序,但隨後的Python腳本被阻塞,直到程序完成。 GUI被凍結並且無法使用。
如何我已經開始Python的一個完全獨立的和無關的任務,然後繼續運行,這樣我可以打開其他程序,甚至終止Python腳本,而不影響它啓動的程序?
看到同樣的問題:如何調用從蟒蛇的程序,而無需等待其返回](http://stackoverflow.com/questions/2602052/how-to-call-a-program-from-python-無需等待換它到返回) –