import sqlite3 con = sqlite3.connect("users.db") con.row_factory = sqlite3.Row # <-- This line does the trick.