import sqlite3 as db conn = db.connect(r'D:/data/test.db') print ('Opend database successfully ') #conn.row_factory = db.Row cursor = conn.cursor() results = cursor.execute("select * from Meter") rows = cursor.fetchall() for row in rows: print(row)#"%s %s %s" % (row["id"], row["No"], row["Name"]) print(' ') print ('close database successfully') conn.close()