sqlite 連線範例

# -*- coding: utf-8 -*-
import sqlite3
conn = sqlite3.connect('starbucks.sqlite')
cur=conn.cursor()

cur.execute("insert into 'stores' ('longitude','latitude','name','address','tel','wifi','notes') VALUES(20,100,'測試店家','台北市羅斯福路1段1號','0222223333','Y','')")
cur.execute('select * from stores')
conn.commit()

for store in cur.fetchall():
	print(store)

#print(cur.fetchall()[99])
cur.close()
conn.close()

發表迴響

你的電子郵件位址並不會被公開。 必要欄位標記為 *