import sqlite3 as dbapi con = dbapi.connect('examp_database.sqlite') cur = con.cursor() cur.execute("SELECT * FROM Experiment") record = cur.fetchone() while record: print record record = cur.fetchone() cur.execute("SELECT * FROM Experiment WHERE Project = 'Teleportation'") myqueryrecords = cur.fetchall() myqueryrecords con.text_factory = str current_experiment = 'Teleportation' cur.execute("SELECT * FROM Experiment WHERE Project = ?", (current_experiment,)) myqueryrecords = cur.fetchall() myqueryrecords cur.execute("INSERT INTO Experiment VALUES ('gimli', 'TrollKilling', '1', 112, '1954-07-21')") con.commit() cur.execute("SELECT * FROM Experiment WHERE Project = 'TrollKilling'") myqueryrecords = cur.fetchall() myqueryrecords cur.execute("DELETE FROM Experiment WHERE Project='TrollKilling'") con.commit() cur.execute("SELECT * FROM Experiment WHERE Project = 'TrollKilling'") myqueryrecords = cur.fetchall() myqueryrecords new_data_records = [('mschilling', 'genetics', 1, 112.0, '2005-07-21'), ('jkoch', 'bees', 1, 7.2, '2012-01-15'), ('akleinhesselink', 'commecol', 1, 2.5, '2010-05-05')] cur.executemany("INSERT INTO Experiment VALUES (?, ?, ?, ?, ?)", new_data_records) cur.execute("SELECT * FROM Experiment") cur.fetchall()