📜  docx 到 html python - 任何代码示例

📅  最后修改于: 2022-03-11 14:56:38.556000             🧑  作者: Mango

代码示例2
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)