Python 中的 html 到 .doc 转换器?
我正在使用 pisa,它是一个用于 Python 的 HTML 到 PDF 转换库。
Word 文档是否存在同样的东西:Python 的 HTML 到 .doc 转换库?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
我正在使用 pisa,它是一个用于 Python 的 HTML 到 PDF 转换库。
Word 文档是否存在同样的东西:Python 的 HTML 到 .doc 转换库?
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(4)
您可以使用 Windows 的 pywin32 python 扩展中的 win32com,让 MS Word 为您转换它。一个简单的例子:
You could use win32com from the pywin32 python extensions for windows, to let MS Word convert it for you. A simple example:
虽然我不知道有一个直接模块可以让您进行转换,但是:
Though I am not aware of a direct module that can allow you to convert this, however:
如果其他人在这里尝试以相反的方式进行转换,上面的代码可以工作,但您需要修改 FileFormat 值。
http://msdn.microsoft.com/en-us/library/ff839952.aspx
示例:过滤后的 html 为 10,而不是 0。
In case anybody else lands here attempting to convert the other way around, the above code works, but you need to modify the FileFormat value.
http://msdn.microsoft.com/en-us/library/ff839952.aspx
Example: Filtered html is 10, instead of 0.
使用 python3.x 更新修复此问题:
Update with a python3.x fix this: