python-docx 实现分栏
作者:互联网
找了很久python-docx如何实现分栏都找不到,百度搜索的都是分页而不是分栏,python-docx文档生肉看起来又太费劲,结果上外网一搜索就找到了
from docx import Document
from docx.oxml import OxmlElement
from docx.oxml.ns import qn
document = Document()
section = document.sections[0]
sectPr = section._sectPr
cols = sectPr.xpath('./w:cols')[0]
cols.set(qn('w:num'),'2')
document.save('demo.docx')
标签:docx,python,cols,import,document,分栏 来源: https://blog.csdn.net/jrqz776/article/details/115031232