Convert to HMTL
Tags: #word #microsoft
Author: Unknown

Input

Install package

1
!pip install mammoth
Copied!

Import library

1
import mammoth
Copied!

Model

Reading file and converting

1
with open("naas.docx", "rb") as docx_file:
2
result = mammoth.convert_to_html(docx_file)
3
html = result.value # The generated HTML
4
messages = result.messages # Any messages, such as warnings during conversion
Copied!

Output

Converted

1
html
Copied!
Copy link
Edit on GitHub