📅  最后修改于: 2022-03-11 14:56:38.556000             🧑  作者: Mango
import mammoth
custom_styles = "b => i"
with open(input_filename, "rb") as docx_file:
result = mammoth.convert_to_html(docx_file, style_map = custom_styles)
text = result.value
with open('output.html', 'w') as html_file:
html_file.write(text)