擅长:python、mysql、java
<p>最后两个参数是连接的,因此<em>无法</em>工作;这实际上与在终端<code>gs -dSAFER -dBATCH -dNOPAUSE -sDEVICE=jpeg '-sOutputFile=/home/user/output.jpg /home/user/downloads/test.pdf'</code>中运行相同,这是您不希望工作的。在</p>
<p>把最后两个分开,就可以了:</p>
<pre><code>output = Popen(['gs', '-dSAFER', '-dNOPAUSE', '-dBATCH', '-sDEVICE=jpeg', '-sOutputFile=/home/user/output2.jpg', '/home/user/downloads/test.pdf'])
</code></pre>