创建和更新Microsoft Word.docx文件。
python-docx-whtsk的Python项目详细描述
python docx whtsky公司
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/pull/210)
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)
- 允许表格查看(页眉行/列、页脚行/列、带区)修改。https://github.com/python-openxml/python-docx/pull/579
- 为段落添加了字体属性。https://github.com/python-openxml/python-docx/pull/417
- 项目
标签: