from docx import Document
doc = Document(r"C:\Users\Administrator\Desktop\新建文件夹\test.docx")
paragraph3 = doc.add_paragraph()
paragraph3.add_run("我被加粗了文字块儿").bold = True
paragraph3.add_run(",我是普通文字块儿,")
paragraph3.add_run("我是斜体文字块儿").italic = True
doc.save(r"C:\Users\Administrator\Desktop\新建文件夹\test.docx")