From 7706e0d4814784b9a853d660a12c35805eb1a9d6 Mon Sep 17 00:00:00 2001 From: quirinecker Date: Mon, 12 Feb 2024 12:08:10 +0100 Subject: [PATCH] fixed file write and read --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 248b627..418f75c 100644 --- a/main.py +++ b/main.py @@ -81,8 +81,9 @@ def find_score_by(username: str) -> Score | None: def main(): f = open('scores.json', 'r') scoresDictionary: list[Dict[str, Any]] = json.loads(f.read()) - mappedScores = list(map(lambda score: Score(**score), scoresDictionary)) - scores = mappedScores + + for scoreObject in scoresDictionary: + scores.append(Score(**scoreObject)) app.run(debug = True)