From 4e627eee89769388f95a6f1b4e5a79466f41e3fe Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Sun, 5 Jul 2020 00:14:06 +0200 Subject: Initial commit --- trainer.py | 88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 trainer.py (limited to 'trainer.py') diff --git a/trainer.py b/trainer.py new file mode 100644 index 0000000..9d91338 --- /dev/null +++ b/trainer.py @@ -0,0 +1,88 @@ +import random +import os +import glob + +diagnosis = { + "1.png": (2, "retrosternales Struma"), + "2.png": (2, "retrosternales struma"), + "3.jpg": (2, "Lungenemphysem"), + "4.jpg": (2, "Lungenemphysem"), + "5.png": (2, "freie Luft"), + "6.png": (2, "freie Luft"), + "7.png": (2, "Pneumonie"), + "8.png": (2, "Pneumonie"), + "9.jpg": (2, "karzinom"), + "10.jpg": (2, "karzinom"), + "11.jpg": (2, "Lymphom"), + "12.jpg": (2, "Lymphom"), + "13.png": (2, "Pleuraerguss"), + "14.png": (2, "Pleuraerguss"), + "15.png": (2, "Pneumothorax links"), + "16.png": (2, "Pneumothorax links"), + "17.jpg": (2, "Metastasen"), + "18.jpg": (2, "Metastasen"), + "19.jpg": (2, "Lungenfibrose"), + "20.jpg": (2, "Lungenfibrose"), + "21.jpg": (1, "Kardiale Stauung"), + "22.jpg": (1, "Kardiale Stauung"), + "23.jpg": (2, "Lymphadenopathie"), + "24.png": (2, "Lymphadenopathie"), + "25.jpg": (2, "Oberlappenatelektase"), + "26.jpg": (2, "Oberlappenatelektase"), + "rt\\ atelektase.png": (1, "untarlappenatelektase"), + "rt\\ bronchial\\ ca.png": (1, "bronchial ca"), + "rt\\ freie\\ intraabdominelle\\ luft.png": + (1, "freie intraabdominelle luft"), + "rt\\ hiatushernie.png": (1, "hiatushernie"), + "rt\\ luft.png": (1, "weichteilemphysem"), + "rt\\ pulmonal\\ alveoläre\\ stauung.png": + (1, "pulmonal alveoläre stauung"), + "rt\\ pulmon\\ st\\ die\\ zweite\\ kerley.png": (1, "pulmonale stauung"), + "rt\\ spannungspneu.png": (1, "spannungspneumothorax"), + "rt\\ struma.png": (1, "struma"), + "rt\\ weichteilemphysem.png": (1, "weichteilemphysem"), +} + +# get all files matching the pattern +#files = glob.glob("res/*") + +# clear screen function +#def cls(): +# os.system('cls' if os.name == 'nt' else 'clear') + +# extract number x from res/x.png +#def getint(name): +# basename = name.partition('.')[0] +# _, num = basename.split('/') +# return int(num) + +# sort files by number +#files.sort(key=getint) + +fdiag = list(range(1, 36)) +random.shuffle(fdiag) +# print greeting +print("Ultimativer Osce-Trainer!\n") + +for x in fdiag: + # uncomment for debug purposes + #print(files[x]) + # the -F enabeles fullscreen mode + f = list(diagnosis.keys())[x] + if x <= 26: + f1 = list(diagnosis.keys())[x & (~1)] + f2 = list(diagnosis.keys())[x | 1] + os.system(f"feh -F res/{f1}") + if diagnosis[f][0] == 2: + os.system(f"feh -F res/{f2}") + else: + os.system(f"feh -F res/{f}") + + p = input(" Was ist deine Diagnose? \n") + if p.lower() in diagnosis[f][1].lower() and len(p) > 2: + print("richtig") + else: + print("falsch, die richtige Lösung ist: " + diagnosis[f][1]) + input("Press enter to continue") + +print("\n\n\nAlles Geschaff!!!!\nHerzlichen Glückwunsch") -- cgit v1.2.3-54-g00ecf