美文网首页
Python中,常用Selenium方法封装(6)

Python中,常用Selenium方法封装(6)

作者: 嫩牛_软件测试_笔记 | 来源:发表于2018-09-27 11:52 被阅读0次

封装了读取 Yaml 格式文件内容的方法


class YamlHelper(object):

    def get_config_dict(self, f):
        """
        获取所有配置
        :param f: 想要读取的 yaml 文件
        :return: 字典方式
        """
        with open(f, mode='r', encoding='utf8') as file_config:
            config_dict = yaml.load(file_config.read())
            return config_dict

相关文章

网友评论

      本文标题:Python中,常用Selenium方法封装(6)

      本文链接:https://www.haomeiwen.com/subject/erheoftx.html