I would like to write a list of lists : k = [['1','a'],['2','b'],['3','c']] - to a cell in a Python excel sheet.
My code:
workbook = xlsxwriter.Workbook('names.xlsx')
worksheet = workbook.add_worksheet()
worksheet.write('A1', 'Generic Name')
I have tried:
worksheet.write_row('B1', allmajor)
which causes the contents the list k to be written in separate cells (B1, C1, D1..).
Doing: worksheet.write('B1', ','.join(k)) causes the cotnents of cell B1 to have strings like - '1','a','2','b','3','c'
Is there any way in which I can write a list to a cell such that cell B1 looks like [['1','a'],['2','b'],['3','c']]? Is there any other module in Python that can facilitate this?