fist config json file
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
|
||||
CONFIG_DIR = Path(__file__).parent
|
||||
|
||||
def load_config(config_name: str):
|
||||
config_path = CONFIG_DIR / f"{config_name}.json"
|
||||
with open(config_path, 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
def save_config(config: dict, config_name: str):
|
||||
config_path = CONFIG_DIR / f"{config_name}.json"
|
||||
with open(config_path, 'w') as f:
|
||||
json.dump(config, f, indent=4)
|
||||
Reference in New Issue
Block a user