from datetime import datetime
conn = sqlite3.connect('racket_hits.db') cursor = conn.cursor()
cursor.execute(''' CREATE TABLE IF NOT EXISTS hits ( id INTEGER PRIMARY KEY AUTOINCREMENT, hit_time TEXT NOT NULL ) ''') conn.commit()
def add_hit(): hit_time = datetime.now().strftime('%Y-%m-%d %H:%M:%S') cursor.execute('INSERT