From 11962b7a70f49211daac27de3e58206cfb52a1b7 Mon Sep 17 00:00:00 2001 From: none Date: Sat, 9 Mar 2024 15:29:21 +0300 Subject: [PATCH] up --- db.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/db.py b/db.py index 7c86df9..34daf13 100644 --- a/db.py +++ b/db.py @@ -7,9 +7,15 @@ if not os.path.exists('config.json'): with open("config.json", "w") as outfile: outfile.write(js) print('Created new config.json') + exit() def read(file = 'config.json'): + if not os.path.exists(file): + with open(file, "w") as f: + f.write("{}") + f.close() + with open(file, "r", encoding="utf-8") as openfile: db = json.load(openfile) return db