some things

This commit is contained in:
Nikolaj
2021-12-29 12:24:07 +01:00
parent b36be893a4
commit 0ef63ca80b
9 changed files with 46 additions and 38 deletions

View File

@ -11,6 +11,21 @@ IMAGE_SIZE = (1800, 1200)
MARGINS = 60
def read_file(path: str) -> dict:
with open(path, "r", encoding="utf-8") as file:
game_dict = dict(
[tuple(line.split(":")) for line in file.read().split('\n')]
)
return game_dict
def write_file(path: str, game: dict):
game_string = "\n".join(
[f"{key}:{value}" for key, value in game.items()]
)
with open(path, "w", encoding="utf-8") as file:
file.write(game_string)
def base64(num: int) -> str:
temp = ""