本文實例講述了python查詢sqlite數(shù)據(jù)表的方法。分享給大家供大家參考。具體實現(xiàn)方法如下:
import sqlite3 as dbconn = db.connect('mytest.db')conn.row_factory = db.Rowcursor = conn.cursor()cursor.execute("select * from person")rows = cursor.fetchall()for row in rows: print("%s %s %s" % (row["name"], row["age"], row["address"]))conn.close()希望本文所述對大家的Python程序設計有所幫助。
新聞熱點
疑難解答
圖片精選