创建和更新Microsoft Word.docx文件。

python-docx-whtsk的Python项目详细描述


python docx whtsky公司

https://travis-ci.com/whtsky/python-docx.svg?branch=master

python docx whtsky是一个用于创建和更新microsoftword的python库 (.docx)文件。在

更多信息请参见python-docx documentation

发布历史记录

0.8.10.3(2019-11-11)

  • TableCell的add_table方法现在接受firstCol, firstRow, lastCol, lastRow, hBand, vBand)。在

0.8.10.2(2019-10-23)

<详细信息>示例

https://github.com/python-openxml/python-docx/issues/25#issuecomment-143231954

fromdocximportDocumentdocument=Document()# Add desired numbering styles to your template file.# Extract abstractNumId from there. In this example, abstractNumId is 10numId=document.get_new_list("10")# Add a listp=document.add_paragraph(style='ListParagraph',text="a")p.num_id=numIdp.level=0p=document.add_paragraph(style='ListParagraph',text="b")p.num_id=numIdp.level=1p=document.add_paragraph(style='ListParagraph',text="c")p.num_id=numIdp.level=1p=document.add_paragraph(style='ListParagraph',text="d")p.num_id=numIdp.level=0p=document.add_paragraph(style='ListParagraph',text="e")p.num_id=numIdp.level=1p=document.add_paragraph(style='ListParagraph',text="f")p.num_id=numIdp.level=0# Restart numbering at the outer levelnumId=document.get_new_list("10")# Add the same list once again. The numbering is restartedp=document.add_paragraph(style='ListParagraph',text="a")p.num_id=numIdp.level=0p=document.add_paragraph(style='ListParagraph',text="b")p.num_id=numIdp.level=1p=document.add_paragraph(style='ListParagraph',text="c")p.num_id=numIdp.level=1p=document.add_paragraph(style='ListParagraph',text="d")p.num_id=numIdp.level=0p=document.add_paragraph(style='ListParagraph',text="e")p.num_id=numIdp.level=1p=document.add_paragraph(style='ListParagraph',text="f")p.num_id=numIdp.level=0document.save("num.docx")

0.8.10.1(2019-10-16)

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java使用Jena获取类上的OWL限制   我需要用javadoc记录每一个方法还是java中的“main”方法?   ssl我的Java密钥库中需要什么?   java如何在安卓中实现视图寻呼机适配器?   java LibreOffice 4.4.3在不同服务器上使用jodconverter访问文档   Selenium Webdriver(Java)脚本之间的时间延迟   混合使用路径参数和请求参数的java Rest API   爪哇超级。基类中的toString()方法?   java IntelliJ Idea 2019.2与NPW崩溃   java replaceAll不适用于以下查询   java递归相关:两个数的乘积   java在屏幕/活动之间切换,无需按钮   java试图在GridBagLayout中对齐JcheckBox   java安全远程密码协议SRP和Spring安全