当我用“-V args”调用pandoc时,例如:'-V title=“Wartość”' 在Python脚本中,我得到的输出没有标题..:(
示例: 手动输入pandoca命令(终端):
/usr/bin/pandoc /home/user/program/content.md -V title="Wartość"
-V authors="Jerry" --output=/home/user/program/outputs/book_22.pdf
有效:) 输出文件:pandoc output when use manually pandoc in the terminal
但是当我在python中运行相同的命令时(调用pandoc):
subprocess.call(['/usr/bin/pandoc', '/home/user/program/content.md', '-V title="Wartość", -V authors="Jerry" ', '--output=/home/user/program/outputs/book_33.pdf'])
输出文件:pandoc output when I call to him from python script
如何修复?你知道吗
假设您在Python中运行“同一命令”是不正确的。当参数应该分开时,可以将它们组合成单个字符串。你知道吗
将命令行转换为适合
subprocess.call()
的列表的简单方法是shlex.split()
。你知道吗相关问题 更多 >
编程相关推荐