(2, 'No such file or directory') when trying to open a csv file on Django
I cannot for the life in me figure out why I keep getting this error. So I
have a django module that is running the following code
c = open('file.csv', 'rb')
reader = csv.reader(c)
rows = []
rownum = 0
for row in reader:
# Skip header
if rownum != 0:
rows.append(row)
rownum += 1
c.close()
return rows
A few things to keep in mind. file.csv is in the same directory as the
python file calling this function. I run this SAME code in the python
interpreter, outside of the django environment and it works beautifully. I
have tried rb and r, both don't work. I don't know why it doesn't work.
Is there something I am missing?
I am using python2.6
No comments:
Post a Comment