I am trying with the following code
cursor = connect.cursor()
sqlSelect = "SELECT to_char(t.create_date, 'DD-MM-YYYY') AS CreatedDate,t.ticket_number AS TicketNo,p.name AS Priority,t.person_name AS Person,t.subject AS Subject,s.name AS State, to_char(t.close_date, 'DD-MM-YYYY') AS ClosedDate FROM website_support_ticket t INNER JOIN website_support_ticket_priority p ON p.id = t.priority_id INNER JOIN website_support_ticket_state s ON s.id = t.state_id ORDER BY CreatedDate"
try:
cursor.execute(sqlSelect)
results = cursor.fetchall()
headers = [i[0] for i in cursor.description]
csvFile = csv.writer(open(filePath + fileName, 'w'),
delimiter=',', lineterminator='\r\n',
quoting=csv.QUOTE_ALL, escapechar='\\')
csvFile.writerows(headers)
csvFile.writerows(results)
When I print the headers Output is like
('headers', ['createddate', 'ticketno', 'priority', 'person', 'subject', 'state', 'closeddate'])
and headers just dont write into CSV like headers,

any suggestions how I can print the headers only on the top first row? As of now, every letter of header goes into different rows.
Any suggestion or fix would be really helpful.