unexpected token `;'

bbarbero at inescporto.pt bbarbero at inescporto.pt
Tue Aug 25 12:57:07 CEST 2009


Hello to all!

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).

#!/Library/Frameworks/Python.framework/Versions/2.6/bin/python2.6
#!/bin/bashimport math
import re
import numpy
import string
import os.path
import sys
import commands



l =  
"/Users/bmorab/Audio_Projecto/Data/Palco/PP3_44_distance_matrix/PP3_44_5.mf"

Col = open(l, 'r')
colist= []
songlist = []
for line in Col:
         #print line
         song = os.path.split(line)[1]
         #print song
         songlist.append(song)
         colist.append(line)



cmd = "sfplay " + colist[2]
print cmd
fileout = commands.getoutput(cmd)
print fileout



It basically reads song files from the .mf file, stores them in a list  
and play  one of the songs from the list. It does work with some music  
but mostly it gives an error like this:

sfplay  
/Volumes/HAL/Datasets/Audio/PalcoPrincipal/mp3_resampled_44100/10005.mp3

sh: -c: line 1: syntax error near unexpected token `;'
sh: -c: line 1: `; } 2>&1'


Ive been searching for the meaning of the error, and It really depends  
on the script, but I would conclude that I am missing a punctuation  
mark??

Thank you very much for taking your time reading my request.

Looking forward to hearing from you.

Regards,
Bea


----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.



More information about the Python-list mailing list