import csv
with open('v.csv', 'w') as csvfile:
cwriter = csv.writer(csvfile, delimiter=' ', quotechar='|', quoting=csv.QUOTE_MINIMAL)
for w, c in p.items():
cwriter.writerow(w + c)
Aqui, p
está um dicionário w
e c
ambos são strings.
Quando tento gravar no arquivo, ele relata o erro:
ValueError: I/O operation on closed file.