Files
voctrain/init_db.py
T
2022-11-02 21:58:55 +01:00

18 lines
394 B
Python
Executable File

#!/usr/bin/env python3
import sqlite3
connection = sqlite3.connect('vokabeln.db')
with open('schema.sql') as f:
connection.executescript(f.read())
cur = connection.cursor()
cur.execute("INSERT INTO eintraege ( gaszaehler, stromzaehler, wasserzaehler, wetterinfo) VALUES ( ?, ?, ?, ?)",
('', '', '127', 'kalt aber oho')
)
connection.commit()
connection.close()