From ffe22ef6d621367bc9699b423277704ec40f8b41 Mon Sep 17 00:00:00 2001 From: nfx Date: Thu, 19 Dec 2024 15:30:03 +0100 Subject: [PATCH] Supprimer 'json_to_bin.py' --- json_to_bin.py | 21 --------------------- 1 file changed, 21 deletions(-) delete mode 100644 json_to_bin.py diff --git a/json_to_bin.py b/json_to_bin.py deleted file mode 100644 index e72502d..0000000 --- a/json_to_bin.py +++ /dev/null @@ -1,21 +0,0 @@ -""" - Converts json level data files into binary level data -""" -import json -from os import listdir -from os.path import isfile, join - -LVL_DIR = "lvl/" -BIN_DIR = "lvl_bin/" - -if __name__ == "__main__": - files = [f for f in listdir(LVL_DIR) if isfile(join(LVL_DIR, f))] - decoder = json.JSONDecoder() - for v in files: - file = open(join(LVL_DIR, v), "r", encoding="utf-8") - content = decoder.decode(file.read()) - newfile = open(join(BIN_DIR, v.replace(".json", ".dat")), "wb") - bin_content = b'' - for line in content: - bin_content += bytes(line+[255]) - newfile.write(bin_content)