Python Forum

Full Version: Only getting last record saved...Why
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Can someone please show me the code to print the info to a csv file. I have written code several different ways and still just get the last line in every file I read in. Here is the code of the loop. I can not figure out how to write first iteration and then append the next one.

for line in csv_reader:
                     
                                             
 
                 
                     
                    h = {'track' : line[0],
                    'race_number' : line[2], 
                    'todays_surface' : line[6],
                     
                     
                     
 
                 
                        }
 
Pages: 1 2