-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinitalize.py
27 lines (24 loc) · 900 Bytes
/
initalize.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from os.path import exists
from json import load
import requests
def initalize():
for path_config in ['rules/place.txt','rules/rules.txt','rules/types.txt']:
if exists(path_config):
print(f'{path_config} found!')
else:
print(f'{path_config} not found, creating {path_config}...')
f = open(path_config,'w')
f.close()
if not exists('config.json'):
print("no config.json! downloading one from github")
config_json = requests.get('https://raw.githubusercontent.com/MeBadDev/Game-Idea-Generator/master/config.json')
f = open('config.json','w')
f.write(str(config_json.content.decode()))
f.close()
def get_result(filepath="main.py"):
f = open(filepath,'r')
contents = f.read()
f.close()
return contents
if __name__ == '__main__':
initalize()