Platinum Partner

Run A External Command From Python

with new subprocess module (py2.4)

from subprocess import Popen,PIPE

p = Popen(file, shell=True,stdout=PIPE,stderr=PIPE)
out = string.join(p.stdout.readlines() )
outerr = string.join(p.stderr.readlines() )


with old way :

import os
out= string.join(os.popen(file).readlines())


or

os.spawnvp(os.P_WAIT,"/usr/bin/mplayer",["","-ao","pcm",file])

# or 

os.spawnvp(os.P_NOWAIT,"/usr/bin/mplayer",["","-ao","pcm",file])

{{ tag }}, {{tag}},

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}
{{ parent.authors[0].realName || parent.author}}

{{ parent.authors[0].tagline || parent.tagline }}

{{ parent.views }} ViewsClicks
Tweet

{{parent.nComments}}