摘要: for paragraph in doc.paragraphs: for run in paragraph.runs: if run.element.xml.startswith('<w:drawing'): inline = run.inline_shapes[0] if inline.has_i 阅读全文
posted @ 2023-09-06 15:23 祺琪 阅读(607) 评论(0) 推荐(0)
摘要: def iter_block_items(parent): """ Generate a reference to each paragraph and table child within *parent*, in document order. Each returned value is an 阅读全文
posted @ 2023-09-06 15:10 祺琪 阅读(265) 评论(0) 推荐(0)
摘要: import re import os#需要批量替换内容文件所处的文件夹地址 filepath = r'D:\Python-study\word-test\test'#该文件夹下的所有文件名列表 fileList = os.listdir(filepath) print(fileList)#保存文件 阅读全文
posted @ 2023-09-06 10:56 祺琪 阅读(324) 评论(0) 推荐(0)
摘要: import docx from docx.document import Document from docx.table import _Cell, Table from docx.oxml.text.paragraph import CT_P from docx.text.paragraph 阅读全文
posted @ 2023-09-06 08:48 祺琪 阅读(422) 评论(1) 推荐(0)