os.popen3 with windows; help?

Lad export at hope.cz
Tue Oct 26 04:35:14 EDT 2004


"Russell E. Owen" <rowen at cesmail.net> wrote in message news:<rowen-1B99F3.15314025102004 at gnus01.u.washington.edu>...
> I'm trying to launch an application from Python 2.3 on Windows. The 
> application is "ds9" (an image viewer), and is installed in C:\Program 
> Files\ds9\ds9
> 
> On unix I just do:
> os.popen3("ds9")
> and close the returned files and all is good. (I'm not trying to 
> communicate with the program via popen3 and so had been using 
> os.spawnlp, but that doesn't exist on Windows.)
> 
> On Windows os.popen3("ds9") does nothing, and the stderr returned from 
> os.popen3 has a message saying the program is unknown.
> 
> So I tried being specific:
> os.popen3("C:\\Program Files\\ds9\\ds9")
> This also fails and the program that is not found is "C:\Program", 
> suggesting that the space in "Program Files" is causing the problem. The 
> following failed in exactly the same way:
> os.popen3("C:\\Program\ Files\\ds9\\ds9")
> 
> Any suggestions?
> 
> -- Russell
> 
> P.S. I installed the app using its Windows binary installer, which 
> unpacks a few files in C:\\Program files\. Windows doesn't seem to know 
> the program exists; it's not in the task bar, for example. But one can 
> double-click it to run it.

I think the problem is in long name folder: Program Files. So, try

Progra~1 instead of Program Files



More information about the Python-list mailing list