python操作sqlites
一丶数据库导出Excel报表
import sqlite3
from xlsxwriter.workbook import Workbook
workbook = Workbook('output.xlsx')
worksheet = workbook.add_worksheet()
# 传入数据库路径
conn=sqlite3.connect('jwxt.db')
c=conn.cursor()
mysel=c.execute("select * from Grade where JXBID='JXB001'")
for i, row in enumerate(mysel):
for j, value in enumerate(row):
worksheet.write(i, j, value)
workbook.close()