import sqlite3 conn = sqlite3.connect('file.txt') cur = conn.cursor() cur.execute(''' CREATE TABLE Table (first TEXT, second INTEGER)''') #Do things with Table for row in cur.execute('SELECT * FROM Table') : print(row) cur.close()