fixed file write and read

This commit is contained in:
2024-02-12 12:08:10 +01:00
parent dfda42cab1
commit 7706e0d481

View File

@@ -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)