import csv data = ( ("ID_NUMBER", "ANOTHER_ID_NUMBER"), (1, 2), ) writer = csv.writer(open("test.csv", 'w'), dialect='excel') for row in data: writer.writerow(row)