Pretty new to python, forgive me if this is the main question about learning how to use CSV files.
import csv theReader = csv.reader(open('filename.csv'), delimiter=',') for line in theReader: print line
So, I managed to open the file and print it on my screen. But I'm trying to write data to dictionaries.
This is a CSV example:
Name,Age,Goals,Passes,Fouls Ted,21,1,20,1 Ben,28,5,14,4
Now I need to create one dictionary with headings as a dictionary key (ideally skipping the "name"), and then the dictionary values ββthat will be filled with statistics.
Then I will create another dictionary with names: dates (dates that I add manually) as a key: value
Am I even right to use the CSV schedule, or should I do it through a standard file and separate the lines with a comma?
source share