2009-10-31 48 views

回答

6

您希望shell=True選項,使其執行shell命令:

import subprocess 
subprocess.Popen("sleep 4s && echo right thar, right thar",shell=True); 
print 'i like it when you put it' 

這將產生:

I like it when you put it 
[4 seconds later] 
right thar, right thar