Posted By

manatlan on 09/09/09


Tagged

python process


Versions (?)

run process


 / Published in: Python
 

  1. from subprocess import Popen,PIPE
  2.  
  3. p = Popen(file, shell=True,stdout=PIPE,stderr=PIPE)
  4. out = string.join(p.stdout.readlines() )
  5. outerr = string.join(p.stderr.readlines() )
  6.  
  7.  
  8. # old ways py<2.4
  9.  
  10. import os
  11. out= string.join(os.popen(file).readlines())
  12.  
  13. os.spawnvp(os.P_WAIT,"/usr/bin/mplayer",["","-ao","pcm",file])
  14.  
  15. # or
  16.  
  17. os.spawnvp(os.P_NOWAIT,"/usr/bin/mplayer",["","-ao","pcm",file])

Report this snippet  

You need to login to post a comment.