from docx import Document import os import sys import time import docx from docx.oxml.ns import qn from docx.shared import RGBColor from docx.shared import Pt
# 创建一个新的Word文档对象 doc = Document() doc.styles['Normal'].font.name = u'等线' doc.styles['Normal']._element.rPr.rFonts.set(qn('w:eastAsia'), u'等线') doc.styles['Normal'].font.size = Pt(10.5) doc.styles['Normal'].font.color.rgb = RGBColor(0,0,0) for i inrange(0,100): # 添加段落 run = doc.add_paragraph(f'{i+1} \n【K】\n全国\n大厢\n音乐、美食、派对、新体验!')