我想编写一个python脚本来自动将libreoffice ott模板转换为普通odt文件。 如果我转到终端(bash shell)并键入:
soffice --headless --convert-to odt "/path/template.ott" --outdir '/targetpath/template.odt'
输出如预期,在新的目标位置有一个odt文件。在
当我编写脚本时(如:
^{pr2}$输出结果显示
[Errno 2] No such file or directory
当我这样打电话时:
subprocess.call(["soffice", "--headless", "--convert-to", "odt", pipes.quote(oldpath),outdir])
结果是soffice的帮助文本,原因是:
LibreOffice 4.2.8.2 420m0(Build:2)
Unknown option: --outdir /targetpath/template.odt
...
为什么不试试呢操作系统? 在
相关问题 更多 >
编程相关推荐