List of Dictionary to xlwt
问题 I have a list of dictionary and i want to convert it to excel using xlwt . I'm new to xlwt. Can you help me? Im using it as a function to receive list of dict and convert it to excel and then return. I have this list of dict. {'id':u'1','name':u'Jeff'} {'id':u'2','name':'Carlo'} 回答1: Make a worksheet. Then use Worksheet.write to fill a cell. data = [ {'id':u'1','name':u'Jeff'}, {'id':u'2','name':'Carlo'}, ] import xlwt w = xlwt.Workbook() ws = w.add_sheet('sheet1') columns = list(data[0].keys