t-time.py 文件源码

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

项目:t-time 作者: theandrewbailey 项目源码 文件源码
def readHtmlTemplate(self,templateFilename="t-time.html"):
        """read entire HTML template and optionally insert CSS

        arguments:
        templateFilename -- optional, if template is different than t-time.html
        """
        template=""
        try:
            with open(templateFilename,"r",encoding="utf-8") as templatefile:
                for line in templatefile:
                    template+=line
        except (FileNotFoundError,BaseException) as ex:
            handleException(ex,
                "File "+ex.filename+" does not exist. This is the HTML template to export the data.",
                "There was a problem opening "+ex.filename+". This is the HTML template to export the data.")
        if self.css is not None:
            template=template.replace('<link rel="stylesheet" href="t-time.css" />',self.css,1)
        self.template=Template(template)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号