我有问题,使用subprocess.Popen
从python调用pandoc。它全部在控制台中工作。这是代码。现在使用subprocess从python调用pandoc。打开
# Test markdown file
here is just a simple markdown file.
我的Python代码使用filename
是完整路径我的降价文件:
import subprocess
fileout = os.path.splitext(filename)[0] + ".pdf"
args = ['pandoc', filename, '-o', fileout]
subprocess.Popen(args)
我也尝试过各种方法来捕捉一个错误,但没有奏效。在控制台中,然而,一切都很好运行:
pandoc '[filename]' -o '[fileout]'