列表索引超出范围
from docx import Documentfrom docx.shared import Cm
file = Document('练习4.docx')
run = file.tables.cell(0,0).paragraphs.add_run()
run.add_picture('图片.jpg',width=Cm(7),height=Cm(7))
file.save('练习5.docx')
报错:Traceback (most recent call last):
File "C:\Users\Administrator\Word自动化\图片.py", line 5, in <module>
run = file.tables.cell(0,0).paragraphs.add_run()# 查看,设置单元格
IndexError: list index out of range
这个问题已经解决了{:10_245:}
页:
[1]