I'm having trouble with opening files, python (2.7) tells me that there is no such file, but there is.
csvData = None
csvHeader = None
os.chdir("../result/files/")
for fileName in os.listdir("."):
if fileName.endswith(".csv"):
print fileName
with open("../result/files/"+fileName, 'rb') as csvFile:
readerCsv = reader(csvFile, delimiter = ';')
csvHeader = readerCsv.next()
_unused = readerCsv.next()
self.data = list.append(list(readerCsv))
this code is suposed to read 5 csv files and store their content in data (except for the first line)
At first chdir tells me he found Stats20120903.csv then I ask the program to open said file but I get an error :
IOError: [Errno 2] No such file or directory: '../files/Stats20120903.csv'
why?
Thanks