Progress
This commit is contained in:
11
ref-test/app/tools/data.py
Normal file
11
ref-test/app/tools/data.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from .. import Config
|
||||
from ..data import data_dir
|
||||
import json
|
||||
|
||||
def load(filename:str):
|
||||
with open(f'./{data_dir}/{filename}') as file:
|
||||
return json.load(file)
|
||||
|
||||
def save(data:dict, filename:str):
|
||||
with open(f'./{data_dir}/{filename}', 'w') as file:
|
||||
json.dump(data, file, indent=4)
|
Reference in New Issue
Block a user