import sqlite3
from xlsxwriter.workbook import Workbook
workbook = Workbook('output2.xlsx')
worksheet = workbook.add_worksheet()
conn=sqlite3.connect('test.sqlite')
c=conn.cursor()
c.execute("select * from abc")
mysel=c.execute("select * from abc ")
for row in mysel:
print row
worksheet.write(0, 0, row[0])
workbook.close()
here is layout of SQLITE database table
id sno
1 100
2 200
3 300
4 400
with worksheet.write(0, 0, row[0]) i get output as 4 in First cell of excel file.
with worksheet.write(0, 0, row[1]) i get output as 400 in First cell of excel file
am not able to figure out the FOR LOOP issue.
please help