📜  html 到 docx python 代码示例

📅  最后修改于: 2022-03-11 14:45:17.415000             🧑  作者: 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)