【发布时间】:2016-07-19 21:00:00
【问题描述】:
我想将特定文件夹中的所有 .doc 文件转换为 .docx 文件。
我尝试使用以下代码,
import subprocess
import os
for filename in os.listdir(os.getcwd()):
if filename.endswith('.doc'):
print filename
subprocess.call(['soffice', '--headless', '--convert-to', 'docx', filename])
但它给了我一个错误: OSError: [Errno 2] 没有这样的文件或目录
【问题讨论】: