Re: [Tutor] Modify a dictionary using csv.DictWriter

2009-01-12 Thread John Fouhy
2009/1/13 Judith Flores : > Hello, Hi Judith, > 1. When I run the code above for the first time, the contents of the > pre-existing file disappear, if I > run the script a second time, now I can see the value of x. This is a consequence of this line: > outfile=open('template.csv','w') # Th

Re: [Tutor] Modify a dictionary using csv.DictWriter

2009-01-12 Thread Alan Gauld
"Judith Flores" wrote I have been struggling a while trying to figure out how to modify a csv file using the csv.DictWriter class. Let's suppose I have the following code: I have never used DictWriter but... outfile=open('template.csv','w') # This is a pre-existing file Opening a

[Tutor] Modify a dictionary using csv.DictWriter

2009-01-12 Thread Judith Flores
Hello, I have been struggling a while trying to figure out how to modify a csv file using the csv.DictWriter class. Let's suppose I have the following code: import csv outfile=open('template.csv','w') # This is a pre-existing file that contains 3 variables (3 columns). The variables will