我有在Python使用Python内soffice,命令工作的终端,但没有在Python子
当我运行在终端下面与LibreOffice中最令人沮丧的问题,我有一点问题都没有,PDF文件生产,我想它,生活是花花公子:
cd /Applications/LibreOffice.app/Contents/MacOS/
./soffice --convert-to pdf --outdir {output_folder} {path_to_docx_file}/{title}.docx
然而,当我试图把它添加到我的python脚本:
SOFFICE = r'/Applications/LibreOffice.app/Contents/MacOS/soffice'
subprocess.Popen([SOFFICE, "--convert-to", "pdf", "--outdir", "{output_folder} ", "{path_to_docx_file}/{title}.docx"])
我收到一条错误消息:
Error: source file could not be loaded
我试图打开所有的二进制文件和文件的所有权限,这仍然不能在python脚本中工作。我究竟做错了什么?