Files
gateway_plc/gateway/config_loader.py
2025-08-13 18:13:09 +08:00

10 lines
293 B
Python

import json
import os
def load_config(config_path="config/config.json"):
"""加载配置文件"""
if not os.path.exists(config_path):
raise FileNotFoundError(f"Configuration file not found: {config_path}")
with open(config_path, "r") as f:
return json.load(f)