Hello, I am trying to read a csv file using DictReader. I am getting error -
Traceback (most recent call last): File "<pyshell#19>", line 1, in <module> r.fieldnames File "/usr/lib/python2.7/csv.py", line 90, in fieldnames self._fieldnames = self.reader.next() ValueError: I/O operation on closed file Here is my code in a Python shell - >>> with open('x.csv','rb') as f: ... r = csv.DictReader(f,delimiter=",") >>> r.fieldnames I have tried to open the file in 'rU', 'r' mode. But still I am getting the above error. Please help. Thanks. -- https://mail.python.org/mailman/listinfo/python-list