Write the headers separately, by creating a new csv.writer()
for the rows:
writer = csv.writer(stringIO)
headers = ['HEADING1', 'HEADING2']
writer.writerow(headers)
writer = csv.writer(stringIO, quotechar='"', quoting=csv.QUOTE_ALL)
values=['value1', 'value2']
writer.writerow(values)
csv.writer()
objects have no way of switching between dialects. Just create a new object if you have to use a different dialect for some rows.