擅长:python、mysql、java
<p>应该使用<code>os.system()</code>而不是<code>subprocess.Popen</code>-如果将命令和参数作为列表给出,则此模块的内容可以正确处理文件名中的空格。在</p>
<blockquote>
<p>On Windows: the Popen class uses CreateProcess() to execute the child
program, which operates on strings. If args is a sequence, it will be
converted to a string using the list2cmdline method. Please note that
not all MS Windows applications interpret the command line the same
way: The list2cmdline is designed for applications using the same
rules as the MS C runtime.</p>
</blockquote>
<p>在你的例子中,那将是</p>
<pre><code>cmd = ["pdftk"] + files_arr + "cat", "output", outputpath + ext]
</code></pre>
<p>然后呢</p>
^{pr2}$