import os
import yaml
import sys
import logging
class PubMethod:
    @staticmethod
    def read_yaml(file):
        if os.path.isfile(file):
            fr = open(file, 'r', encoding='utf-8')
            yaml_info = yaml.safe_load(fr)
            fr.close()
            return yaml_info
        else:
            logging.error(file, '文件不存在')
            sys.exit()

 

相关文章:

  • 2022-02-15
  • 2022-12-23
  • 2022-01-06
  • 2021-12-09
  • 2021-09-13
  • 2021-10-03
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2021-08-07
  • 2022-12-23
  • 2021-10-10
  • 2022-12-23
相关资源
相似解决方案