def registration_table_read(file, fieldnames, rows): with open(file, "rb") as csvfile: reader = unicodecsv.DictReader(csvfile, fieldnames) for row in reader: period_handler(row) row.pop(None, None) row.pop("") rows.append(row)
def summary_table_write(file, fieldnames, rows): with open(file, "w") as csvfile: writer = unicodecsv.DictWriter(csvfile, fieldnames) writer.writeheader() for row in rows: period_handler(row) writer.writerow(row)