import sqlite3 from colorama import Cursor connection = sqlite3.connect('database.db') with open ('schema.sql') as f: connection.executescript(f.read()) cur = connection.cursor() cur.execute("INSERT INTO lists (title) VALUES (?)", ('Cooking',)) cur.execute("INSERT INTO lists (title) VALUES (?)", ('Birds',)) cur.execute("INSERT INTO lists (title) VALUES (?)", ('Homeworks',)) # list_id will start from 1 cur.execute("INSERT INTO items (list_id, content) VALUES (?, ?)", (1, 'zucchini or courgette?') ) cur.execute("INSERT INTO items (list_id, content) VALUES (?, ?)", (2, 'seen pigeon') ) cur.execute("INSERT INTO items (list_id, content) VALUES (?, ?)", (2, 'seen crawl') ) cur.execute("INSERT INTO items (list_id, content) VALUES (?, ?)", (2, 'seen airon') ) cur.execute("INSERT INTO items (list_id, content) VALUES (?, ?)", (3, 'Aiuto mo ci sono gli HAQPAKT') ) connection.commit() connection.close()