import subprocess docx_file='./Docx/《动能定理》巩固练习.docx' temp_markdown='./Res/《动能定理》巩固练习.md' # 1、先用Pandoc转换,得到图片 subprocess.run(['pandoc', docx_file, '-f', 'docx', '-t', 'markdown', '-o', temp_markdown, '--extract-media=./Res/Images/']) # 2、把docx转为图片,然后OCR