我已经用猛犸象试过了:
import mammoth
result = mammoth.convert_to_html("MyDocument.docx")
print (result.value)
Run Code Online (Sandbox Code Playgroud)
我没有得到 HTML,但是这个奇怪的代码:
kbW7yqZoo4h9pYM6yBxX1QFx2pCoPYflXfieIPbtqpT913Vk7OzcZdEk3eO7TbWjvZNTGilsfmRrPwDvB[...]
Run Code Online (Sandbox Code Playgroud)
我也尝试过使用 docx2html,但我无法安装它。当我运行时,pip install docx2html我收到此错误:
SyntaxError: Missing parentheses in call to 'print'
Run Code Online (Sandbox Code Playgroud)