关于python实现html转word(docx)

安装

linux平台

sudo apt install pandoc
pip3 install pypandoc

示例代码

import pypandoc
output = pypandoc.convert_file('1.html', 'docx', outputfile="file1.docx")

其他

这种转换不能使生成的wordhtml完全一致,但是大致相同

posted @ 2019-12-09 15:53  Hello_wshuo  阅读(236)  评论(0编辑  收藏  举报