This repository has been archived on 2023-08-30. You can view files and clone it, but cannot push or open issues or pull requests.
l9_stud_bot/utils/config.py

17 lines
376 B
Python

# -*- coding: utf-8 -*-
import json
import os
def loadJSON(name):
path = f"{name}.json"
if os.path.exists(path):
with open(path, encoding='utf-8') as file:
return json.load(file)
def saveJSON(name, dct):
path = f"{name}.json"
with open(path, "w", encoding='utf-8') as file:
json.dump(dct, file, ensure_ascii=False, indent="\t")