From caaf177826251589c8e224b0d92dad740328b810 Mon Sep 17 00:00:00 2001 From: jonnybravo Date: Tue, 14 Nov 2023 11:13:25 +0100 Subject: [PATCH] commit message from python script --- play_with_sqllite/main.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/play_with_sqllite/main.py b/play_with_sqllite/main.py index e1a7a1f..58c8b17 100644 --- a/play_with_sqllite/main.py +++ b/play_with_sqllite/main.py @@ -70,6 +70,25 @@ def lese_tabellen(): return cursor.fetchall() +def eingabe(): + with sqlite3.connect(script_folder + "/startegie.db") as verbindung: + cursor = verbindung.cursor() + while True: + name = input("Name des Virus: ") + if not name: + break + ort = input("Ort: ") + vorfall = input("Vorfall: ") + sql = """Select * from viren WHERE name = '{name}';""".format(name=name) + cursor.execute(sql) + if cursor.fetchone(): + speicher_aktion(name, ort, vorfall) + else: + print("Virus unbekannt !") + print("Eingabevorgang wurde beendet.") + +def speicher_aktion(): + pass