🏗️ Built framework for games

This commit is contained in:
Nikolaj Danger
2020-07-27 17:18:07 +02:00
parent 6dac0e8bdf
commit 95d5fa685a
7 changed files with 31 additions and 29 deletions

View File

@ -137,13 +137,13 @@ def makeFiles():
finally:
f.close()
# Creates trivia.json if it doesn't exist
# Creates games.json if it doesn't exist
try:
f = open("resources/trivia.json","r")
f = open("resources/games.json","r")
except:
logThis("trivia.json didn't exist. Making it now.")
data = {"questions":{},"users":{}}
with open("resources/trivia.json","w") as f:
logThis("games.json didn't exist. Making it now.")
data = {"trivia questions":{},"users":{}}
with open("resources/games.json","w") as f:
json.dump(data,f,indent = 4)
finally:
f.close()