CSV - sjherrick/code-base GitHub Wiki

CSV

Writer

with open('output.csv', 'w', newline='') as csvfile:
    fieldnames = ['cust_name', 'acct', 'circuit_id']
    writer = csv.DictWriter(csvfile, fieldnames=fieldnames)
    writer.writeheader()
    for row in example_list:
        writer.writerow(row)