创建和更新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第三方库


热门话题
JFrame中的Java多线程   java Servlet异常映射   java无法从输出流读取   swing Java带来的小程序GUI问题   java什么原因导致错误“'void'类型此处不允许”以及如何修复它?   Java选择器select(长)与selectNow的区别   java自定义arraylist<mygames>获得不同   java Icepdf注释让页面消失   java反向整数数组   java I在生成同步“无法解析配置的所有依赖项”时遇到此错误:app:debugRuntimeClasspath   多个虚拟机上的java线程访问单个DB实例上的表,有时会导致性能低下和异常   swing更改Java中的默认按钮,使其看起来“更好”   java慢速MQ主题订阅。并行化不能提高性能   java运行Boggle Solver需要一个多小时。我的代码怎么了?   数据库中的java循环与应用程序中的java循环   正则表达式匹配${123…456}并在Java中提取2个数字?   java如何制作我们软件的试用版   Java内存参数计算   从另一个类调用方法时出现java问题