result.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:HtmlTestRunner 作者: oldani 项目源码 文件源码
def load_template(template):
    """ Try to read a file from a given path, if file
        does not exist, load default one. """
    file = None
    try:
        if template:
            with open(template, "r") as f:
                file = f.read()
    except Exception as err:
        print("Error: Your Template wasn't loaded", err,
              "Loading Default Template", sep="\n")
    finally:
        if not file:
            with open(DEFAULT_TEMPLATE, "r") as f:
                file = f.read()
        return file
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号