我们提供融合门户系统招投标所需全套资料,包括融合系统介绍PPT、融合门户系统产品解决方案、
融合门户系统产品技术参数,以及对应的标书参考文件,详请联系客服。
pip install python-docx
from docx import Document
def create_docx():
document = Document()
document.add_heading('Document Title', 0)
p = document.add_paragraph('A plain paragraph having some ')
p.add_run('bold').bold = True
p.add_run(' and some ')
p.add_run('italic.').italic = True
document.save('demo.docx')
if __name__ == '__main__':
create_docx()
from docx import Document
def read_docx(file_path):
document = Document(file_path)
for para in document.paragraphs:
print(para.text)
if __name__ == '__main__':
read_docx('demo.docx')
from docx import Document
def modify_docx(file_path):
document = Document(file_path)
for para in document.paragraphs:
if 'plain' in para.text:
para.text = para.text.replace('plain', 'modified')
document.save('modified_demo.docx')
if __name__ == '__main__':
modify_docx('demo.docx')