diff options
author | Eddy Pedroni <epedroni@pm.me> | 2024-05-15 16:16:54 +0200 |
---|---|---|
committer | Eddy Pedroni <epedroni@pm.me> | 2024-05-15 16:16:54 +0200 |
commit | 9ce4ec59f0db4e0531c12310ae354ca6c4b763d7 (patch) | |
tree | f218ff01c1b07a31c6f39cff01d0e04afb95a30b | |
parent | f272f083af3d135e82ecdf0ce4e340ee2782364b (diff) |
Clean up main loop, ctrl+c or ctrl+d to exit
-rw-r--r-- | kasus.py | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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="") |