summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEddy Pedroni <epedroni@pm.me>2024-05-15 16:16:54 +0200
committerEddy Pedroni <epedroni@pm.me>2024-05-15 16:16:54 +0200
commit9ce4ec59f0db4e0531c12310ae354ca6c4b763d7 (patch)
treef218ff01c1b07a31c6f39cff01d0e04afb95a30b
parentf272f083af3d135e82ecdf0ce4e340ee2782364b (diff)
Clean up main loop, ctrl+c or ctrl+d to exit
-rw-r--r--kasus.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/kasus.py b/kasus.py
index 68b0be0..57ebc4a 100644
--- a/kasus.py
+++ b/kasus.py
@@ -15,10 +15,16 @@ while True:
total += 1
print(f"{Style.BRIGHT}--- Übung {total} ---{Style.NORMAL}")
print(parameters)
+ print()
print(queryString)
print()
- response = input("> ")
+ try:
+ response = input("> ")
+ except (KeyboardInterrupt, EOFError):
+ # TODO print statistics
+ print("\nBis später!")
+ break
print(f"{Style.BRIGHT}", end="")