win32+popen4

David Bolen db3l at fitlinxx.com
Thu Feb 28 20:42:18 EST 2002


Robin Becker <robin at jessikat.fsnet.co.uk> writes:

> What's the correct way to give a command to popen4 under win32 when the
> command/arguments may have spaces in it. EG I want to use
>
> "c:\program files\dimbo\bongo.exe" "c:\program files\dumbo\my file.dat"

Are you including the quotes in your call to popen4?  E.g.:

   os.popen4(r'"c:\program files\dimbo\bongo.exe"
               "c:\program files\dumbo\my file.dat"')

And if, so which version of Windows are you using?  I thought there
might have been an issue under Win9x platforms with losing quoted
information on the way to using the helper module w9xpopen, but a
quick Google search didn't show up anything, so I may be
mis-remembering.

However, if you are on a 9x platform, and quoting the command just as
you want the command interpreter to see it on the command line doesn't
work, you might just want to revert to using the short (non-space)
version of the name.  So in your example you would replace "program
files" with "progra~1" (or whatever it may be in the unlikely event
it's different than that).

--
-- David
-- 
/-----------------------------------------------------------------------\
 \               David Bolen            \   E-mail: db3l at fitlinxx.com  /
  |             FitLinxx, Inc.            \  Phone: (203) 708-5192    |
 /  860 Canal Street, Stamford, CT  06902   \  Fax: (203) 316-5150     \
\-----------------------------------------------------------------------/



More information about the Python-list mailing list