<div>I ran into an interesting problem trying to spawn a subprocess, so I thought I'd ask if the experts could explain it to me.  I'm spawning a subprocess to run "pdf2txt.py", which is a tool that is distributed with PDFminer to do moderately advanced text-dumps of PDFs.  Yet when I run the same code on my two dev machines - one Win XP, the other Ubuntu 10.04 or 10.10 - it only works on the former and not the later. And its not terribly complicated code.</div>
<div><br></div><div># Code Start</div><div>sp_line = 'python pdf2txt.py -p 1 -o %s "%s"' % ('temp.out', pdf_filename)</div><div>print sp_line</div><div>sp = subprocess.Popen(sp_line)</div><div>sp.wait()</div>
<div>with open('temp.out', 'r') as pdf_handle:</div><div>    #Do stuff to read the file</div><div><br></div><div>The output from the print statements reads:</div><div>python pdf2txt.py -p 1 -o temp.out "Aarts et al (2009).pdf"</div>
<div><br></div><div>That command works on both systems when copied directly to the command-line, and the python script it is a part of works on the Windows machine, but I can't the script to work on Ubuntu for the life of me.  What am I missing?</div>
<div><br></div><div>/b/</div>