config.py

遇事不决,量子力学發表於2024-04-30
"""
@Name: config.py
@Author: zengchuanyin
@Date 2023/9/14-0:2 0
"""
import os
import yaml
project_path = os.path.split(os.path.abspath(__file__))

PRO_DIR = project_path[0]

env_config = os.path.join(PRO_DIR, 'conf_env.yml')

def get_env_msg():
with open(env_config, 'r') as f:
content = f.read()
data = yaml.load(content, Loader=yaml.FullLoader)
return data


if __name__ == '__main__':

data = get_env_msg()

print(data['host']['ip'])


# print(PRO_DIR)