2022-02-18 18:31:13 +08:00

17 lines
382 B
Python

import json
from pathlib import Path
path = Path(__file__).parent / "static"
def get_json(file_name: str):
with open(path / file_name, "r", encoding="utf8") as f:
file_text = f.read()
return json.loads(file_text)
def get_file(file_name: str):
with open(path / file_name, "r", encoding="utf8") as f:
file_text = f.read()
return file_text