【发布时间】:2020-04-18 12:36:39
【问题描述】:
我有一个将 (.doc) 转换为 HTML 文件的代码。代码是:
import mammoth
f=open("c: ......\\demo.docx","rb")
b=open("ABC.html","wb")
document=mammoth.convert_to_html(f)
b.write(document.value.encode('utf8'))
现在ABC.html 将被创建。相反,我需要将该 HTML 文档转换为与 docx 文件相同的名称。
【问题讨论】:
标签: python python-2.7 file file-handling mammoth