fixed file write and read
This commit is contained in:
5
main.py
5
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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user