import subprocess def html_to_word_pandoc(html_file, output_file): subprocess.run(['pandoc', html_file, '-o', output_file]) # 使用示例 html_to_word_pandoc('../static/1.html', '../static/output.docx')