Mar-18-2021, 09:34 AM
(Mar-18-2021, 03:02 AM)Larz60+ Wrote: There are a couple of possibilities here.
Does your csv file have a header? If not, you cannot use DictReader
I think that your print function is never reached.
Add immediately after line3:
print(f"csv file contains {len(list(reader))}")
run it and see how many records are found.
Can i have a function that writes the header at the beggining of the program? or every time i add a new dict i need to write the headers?