[SciPy-user] gplt broken when there is a space in the path to wgnuplot.exe?

Roman Milner roman.milner at baesystems.com
Thu Jan 27 14:07:28 EST 2005


Hello. I've recently been using scipy and including it in a py2exe'ed 
project. The first user I gave it to dropped it in "c:\Program Files" 
and it didn't work.

It turned out this is because I am putting wgnuplot.exe in the same 
directory as everything else and when pyPlot.py popen's the executables, 
it fails when there is a space in the path.

I tried every combination I could think of putting the path in quotes, 
back slashing the quotes, double (and triple) back slashing the back 
slashes, back slashing the spaces, double back slashing the spaces...

I could come up with no answer that way. I ended up hacking pyPlot.py so 
it will split the path to the wgnuplot.exe file, os.chdir into the same 
dir as the executable, run wgnuplot.exe without any path information, 
then os.chdir back into the original cwd.

I'm not sure what repercussions this hack will have (seems like it might 
be bad in a threaded app). Is there a better solution?

Thanks,
^Roman




More information about the SciPy-User mailing list