Dec-25-2020, 11:42 AM
Try it this way:
import csv file1 = '/home/pedro/winter2020/20PY/dumpFiles/attendanceWinter2020_20PY.csv' with open(file1) as fp: crdr = csv.reader(fp, delimiter = ',') for data1 in crdr: print(data1)or if there is a header and you want a dictionary item:
import csv file1 = '/home/pedro/winter2020/20PY/dumpFiles/attendanceWinter2020_20PY.csv' with open(file1) as fp: crdr = csv.DictReader(fp, delimiter = ',') for row in crdr: for key, value in row: print(f"{key}: {value}")