import csv with open('v.csv', 'w') as csvfile: cwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL) for w, c in p.iteritems(): cwriter.writerow(w + c)
Here p is a dictionary, w and c are strings.
When I try to write to a file, it reports an error:
ValueError : I/O operation on closed file.
Help me, I'm really new to python. I am working with Python 2.7.3 Thanks in advance.
python io file-io csv
GobSmack Sep 23 '13 at 6:08 on 2013-09-23 06:08
source share