mkepub.py 文件源码

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

项目:mkepub 作者: anqxyr 项目源码 文件源码
def set_cover(self, data):
        """Set the cover image to the given data."""
        self._cover = 'cover.' + imghdr.what(None, h=data)
        with open(str(self.path / 'EPUB/covers' / self._cover), 'wb') as file:
            file.write(data)
        self._write('cover.xhtml', 'EPUB/cover.xhtml', cover=self._cover)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号