Pruefungskatalog/main_menu.py

31 lines
1.0 KiB
Python
Raw Normal View History

2022-03-21 15:46:51 +01:00
import config
2022-03-18 12:30:09 +01:00
import database_menu
2022-03-21 15:46:51 +01:00
import question_answer_output
2022-03-18 12:30:09 +01:00
# Main Menu
def main_menu():
enable_menu = True
2022-03-19 20:55:12 +01:00
selection = {0: 'Datenbank Menü', 1: 'Zufallsfrage', 2: 'Programm beenden\n'}
2022-03-18 12:30:09 +01:00
print('# Main Menü #\n')
while enable_menu:
for key, value in selection.items():
print(key, value)
selection_number = int(input('Bitte Auswahl treffen\n'))
match selection_number:
case 0:
database_menu.menu()
break
case 1:
2022-03-21 15:46:51 +01:00
while True:
2022-03-21 22:19:07 +01:00
print('#Frage#\n' + '-'*60 + '\n' + question_answer_output.random_question(config.json_file)[0])
input('\nBitte Enter drücken um die Antwort zu sehen\n')
print('#Antwort#\n' + question_answer_output.random_question(config.json_file)[1])
number = int(input('\nZurück zum Hauptmenü\n 1: Ja \n 2: Nein, nächste Frage\n'))
2022-03-21 15:46:51 +01:00
if number == 1:
break
2022-03-18 12:30:09 +01:00
case 2:
2022-03-19 20:55:12 +01:00
break