#!/usr/bin/python import os import sqlite3 import sys if __name__ == "__main__": conn = sqlite3.connect(":memory:") cursor = conn.cursor() cursor.execute('create table t(k primary key);') for i in range(2): cursor.execute('insert into t(k) values(?);', (i,)) pass c = cursor.execute(' select k from t where k == ?;', (0,)) conn.commit() print c.fetchall() c = cursor.execute(' select k from t where k == ?;', (0,))