read_config.py 425 B

1234567891011121314151617
  1. # -*- coding:utf-8 -*-
  2. import yaml
  3. def read_config():
  4. with open("config/env.yaml", "r", encoding="utf-8") as file:
  5. config = yaml.safe_load(file)
  6. return config
  7. address = "https://dcjxb.yunzhixue.cn" if read_config()['env'] == 'product' else "http://dcjxbtest.yunzhixue.cn"
  8. if __name__ == '__main__':
  9. import os
  10. os.chdir(r'C:\Users\86131\Desktop\demo\ai_qback')
  11. print(read_config()['env'])