一、yaml配置文件
二、读取yaml配置文件
import yaml # 配置文件路径 globel_path = 'D:codeAutoprojectBackedManageSystemconfigglobal.yaml' class Login: def do_login(self): with open(globel_path, 'r', encoding='utf-8') as f: result = f.read() yy = yaml.load(result, Loader=yaml.FullLoader) print(yy) print(yy.get('env').get('test')) return if __name__ == "__main__": Login().do_login()