V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
V2EX  ›  king625  ›  全部回复第 1 页 / 共 1 页
回复总数  1
2018-05-11 09:02:02 +08:00
回复了 king625 创建的主题 Python Python 如何在 docx 的指定位置插入图片,并设置图片大小?
@qile1 谢谢, 后来翻了一下 python-docx 的 Issues,发现大神之前发布了解决方法,链接如下:
https://github.com/python-openxml/python-docx/issues/10

代码如下:
paragraph = cell.paragraphs[0]
run = paragraph.add_run()
run.add_picture('image.png')
关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   2672 人在线   最高记录 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 15:12 · PVG 23:12 · LAX 08:12 · JFK 11:12
Developed with CodeLauncher
♥ Do have faith in what you're doing.