config.py

"""
@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)
posted @ 2024-04-30 18:12  遇事不决,量子力学  阅读(8)  评论(0编辑  收藏  举报