doc = Document(r"C:\Users\liqian6\Desktop\python\digao\2. 诚信核查情况模板.docx")
fold = r"C:\\Users\liqian6\Desktop\python\digao\诚信核查"
for root, dirs, files in os.walk(fold):
for d in dirs:
#把模板第一行标题【查询对象名称】改为操作的公司
for paragraph in doc.paragraphs:
paragraph.text = paragraph.text.replace('【查询对象名称】', d)
doc.save(d+'.docx')