我正尝试将.doc文件格式转换成.html文件格式。我已经在Python中使用docx2html将.docx文件转换为.html,但是我在转换.doc格式文件时遇到了问题。我尝试使用Python中的子进程将.doc转换为.docx,但我使用的是MAC OS X,而子进程在MAC上无法使用。我的问题是,我应该只在Python中这样做。有没有办法做到这一点?谢谢使用Python将.doc转换为.html
P.S.我当我使用的子进程的文档转换为DOCX此错误:
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
为什么'subprocess'没有工作?在我的MAC OS X上很好,会发生什么?你可以使用旧的'os.system()',但'subprocess'是首选。 – cdarke
Antiword似乎是读取.doc文件的Python程序包。 – cco
@cdarke我编辑我的问题,并添加我使用子进程时得到的错误 – Minerva