Še en primer
import sqlite3 as dbapi
conn = dbapi.connect("testdb.sqlite")
cur = conn.cursor()
cur.execute("DROP TABLE IF EXISTS test;")
cur.execute("""
CREATE TABLE test (
id integer PRIMARY KEY AUTOINCREMENT,
num integer,
data text
);
""")
cur.execute("INSERT INTO test (num, data) VALUES (100, 'KU-KU');")
cur.execute("SELECT * FROM test;")
rezultat = cur.fetchone()
print(rezultat)
conn.commit()
cur.close()
conn.close()