Mohi Indharan Mohi Indharan - 6 months ago 39
Python Question

problems with showing a unexpected error

i wrote this function a while ago it was working for a while then this happened help me

track is mp3 file cmd converts mp3 into temp.wav file

def convertwmv(track):
oname = 'temp.wav'
cmd='lame --decode {0} {1}'.format( track,oname )
return data


sh: 1: Syntax error: "(" unexpected

File "/home/mako/.local/lib/python3.5/site-packages/scipy/io/", line 233, in read
fid = open(filename, 'rb')
FileNotFoundError: [Errno 2] No such file or directory: 'temp.wav'


Apparently the track name you are using might be having some brackets in it's file name. bash commands don't deal well with special characters and spaces. Try to escape them before formatting your cmd variable. It became apparent after your last edit.