unexpected token `;'
Peter Otten
__peter__ at web.de
Tue Aug 25 07:51:24 EDT 2009
bbarbero at inescporto.pt wrote:
> I am struggling with a script in python for a while now, and decided
> to look for some help. I am running a code that takes commands from
> Marsyas(open source for Music analysis).
> cmd = "sfplay " + colist[2]
> print cmd
> fileout = commands.getoutput(cmd)
You have to ensure here that characters that have a special meaning for the
shell are escaped correctly. The best approach is probably to use subprocess
instead of commands:
fileoutput = subprocess.Popen(["sfplay", colist[2]],
stdout=subprocess.PIPE,
stderr=subprocess.STDOUT).communicate()[0]
Peter
More information about the Python-list
mailing list