当前位置 : 主页 > 编程语言 > python >

关于python实现html转word(docx)

来源:互联网 收集:自由互联 发布时间:2022-06-24
安装 linux平台 sudo apt install pandoc pip3 install pypandoc 示例代码 import pypandoc output = pypandoc . convert_file ( '1.html' , 'docx' , outputfile = "file1.docx" ) 其他 这种转换不能使生成的word与html完全一致,但是

安装

linux平台

sudo apt install pandoc
pip3 install pypandoc

示例代码

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

其他

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


作者:Hello_wshuo​


上一篇:python实现图片转换pdf
下一篇:没有了
网友评论