如何在使用catdoc将.doc文件转换为.txt文件时接受轨迹更改?你知道吗
假设有两个文件'原件.doc'和'已修改.doc'. 你知道吗
'原件.doc'有以下句子:this a test sentence
'已修改.doc'有以下句子:this is a test statement
当我转换已修改.doc到一个.txt文件而不是得到this is a test statement
我得到的是this is a test sentence statement
我正在使用下面的代码。你知道吗
def doc_to_text_catdoc(filename):
(fi, fo, fe) = os.popen3('catdoc -w "%s"' % filename)
fi.close()
retval = fo.read()
erroroutput = fe.read()
fo.close()
fe.close()
if not erroroutput:
return retval
else:
raise OSError("Executing the command caused an error: %s" % erroroutput)
用反义词解决了这个问题。你知道吗
相关问题 更多 >
编程相关推荐