티스토리 뷰
import sqlite3, os
conn = sqlite3.connect('example.db')
c = conn.cursor()
com_te=""
for row in c.execute('SELECT * FROM de_addr order by id desc'):
for m in range(1,9):
com_te = com_te + str(row[m])+","
com_te=com_te+"\n"
f=open("addr.csv","w")
f.write(com_te)
f.close
c.close()
print("CSV file export done.")
댓글