0
from docx import Document
d = Document('/tmp/doc_with_header.docx')
d.sections[0].headers[0].add_paragraph(text='moar header')
d.save('/tmp/moar_headers.docx')
这是代码 这里是错误Python的DOCX页眉/页脚错误
AttributeError: 'Section' object has no attribute 'header'