python-openxml/python-docx

GitHub: python-openxml/python-docx

一个用于以 Python 编程方式读取、创建和更新 Word(.docx)文档的库。

Stars: 5675 | Forks: 1285

# python-docx *python-docx* 是一个用于读取、创建和更新 Microsoft Word 2007+ (.docx) 文件的 Python 库。 ## 安装 ``` pip install python-docx ``` ## 示例 ``` >>> from docx import Document >>> document = Document() >>> document.add_paragraph("It was a dark and stormy night.") >>> document.save("dark-and-stormy.docx") >>> document = Document("dark-and-stormy.docx") >>> document.paragraphs[0].text 'It was a dark and stormy night.' ``` 更多信息请参阅 [python-docx 文档](https://python-docx.readthedocs.org/en/latest/)
标签:逆向工具