python-docx读取、创建和更新word文件的库

python-docx操作word库

python-docx,Python第三方库,可用于读取、创建和更新Microsoft Word 2007+(.docx)文件。

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.'

Github开源协议和stars

MIT license

Github 3.9k stars

python-docx安装命令

pip install python-docx

python-docx依赖项

Python 2.6, 2.7, 3.3, or 3.4

lxml >= 2.3.2

免责声明:内容编辑自网络,仅供参考,不保证正确性,不作任何决策依据!!以上数据皆截止于博文的写稿日期。


行业导航 / Python指南 :
























Copyright © 2022-2024 笨鸟工具 x1y1z1.com All Rights Reserved.