From 492a245c34291b886dff3de3302b17c8c4a57578 Mon Sep 17 00:00:00 2001 From: Hawai Date: Mon, 7 Jun 2021 10:46:09 +0200 Subject: [PATCH] ENTER pressed / fixed issue --- poc_hawai.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/poc_hawai.py b/poc_hawai.py index 5d9c2d2..e515dd1 100644 --- a/poc_hawai.py +++ b/poc_hawai.py @@ -1,6 +1,8 @@ import os import csv import random +import time + from rich.console import Console from rich.markdown import Markdown @@ -77,9 +79,10 @@ def _wait_user_answ(answer): return False else: # ===> if only one possible answer result = input("\nWhat is your choice : ") + if result.lower() == "q" or result.lower() == "quit": return 3 - if result in answer["ANSWER"]: + if result in answer["ANSWER"] and len(result) != 0: return True else: return False @@ -118,6 +121,7 @@ def main(): _display_question(csv_list[count]) # Check if correct answer result = _wait_user_answ(csv_list[count]) + if result == 3: # quit! get_out_while = True elif result: # right answer! @@ -128,5 +132,6 @@ def main(): # End of while _stats(csv_list, player) + if __name__ == "__main__": main()