4d84586a9d
1. MySQL Connection 2. FastGPT database uploader
21 lines
414 B
Python
21 lines
414 B
Python
|
|
# Load Cogfigs
|
|
|
|
import os
|
|
import json
|
|
|
|
# Get the absolute path of the main file
|
|
main_file_path = os.path.abspath(__file__)
|
|
|
|
# Get the directory in which the main file resides
|
|
MAIN_DIRECTORY = os.path.dirname(main_file_path)
|
|
|
|
def load_config():
|
|
# Open and load the JSON file
|
|
with open(MAIN_DIRECTORY+"/config.json", 'r') as file:
|
|
data = json.load(file)
|
|
return data
|
|
|
|
__CONFIG__ = load_config()
|
|
|