import sqlite3 conn = sqlite3.connect('test.sqlite') cur = conn.cursor() cur.executescript('''YOUR SQL CODE HERE''') cur.close()