码YouMe 2018-02-02 08:35 采纳率: 0%
浏览 7344
已结题

Python-docx 能处理页眉页脚吗?

RT python 白板,想用python处理word文件的页眉页脚,python-docx 支持吗?

  for section in doc_obj.sections:
        header = section.header
        footer = section.footer
        if header is not None:
            print (header.text)
        if footer is not None:
            print(footer.text)

AttributeError: 'Section' object has no attribute 'header'

  • 写回答

7条回答 默认 最新

  • threenewbee 2018-02-02 16:03
    关注
    评论

报告相同问题?