niming_igapi/utils/settingLoader.py
2024-11-21 18:14:01 +00:00

16 lines
359 B
Python

import json
def loadset():
with open("./settings.json", "r", encoding = "utf-8") as f:
d = json.load(f)
return d
def writeset(name:str, value):
# 寫入
d:dict = loadset()
d[name] = value
with open("./settings.json", "w", encoding = "utf-8") as f:
json.dump(d, f, ensure_ascii=False)
return d