quizcards.py 文件源码

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

项目:pandas-100 作者: deeplook 项目源码 文件源码
def resize_images(self, story):
        # replace images with resized ones fitting into the available width
        W, H = (
            self.width - self.lm - self.rm), self.height - self.tm - self.bm
        for i, el in enumerate(story):
            if el.__class__ == Image:
                img = PIL.Image.open(el.filename)
                h = W / img.size[0] * img.size[1]
                img = Image(el.filename, width=w, height=h, kind='direct',
                            mask="auto", lazy=1)
                story[i] = img
            elif type(el) == str:
                story[i] = Paragraph(el, bt)  # Spacer(0, 0)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号