[python-win32] Calling a subprocess with spaces in the path
Axiom X11
axiomx11 at gmail.com
Wed Oct 18 22:43:40 CEST 2006
I am trying to run a command as a subprocess, and it keeps choking on the
spaces.
import subprocess
s = 'vlc "C:\\Documents and
Settings\\bk\\Documents\\Resources\\WORKINPR2001.mpeg"
:sout=\#duplicate{dst=display,dst=std{access=udp,mux=ts,dst=224.0.0.0:1234}}
:sout=#duplicate{dst=display,dst=std{access=udp,mux=ts,dst=224.0.0.0:1234}}'
print s
process = subprocess.Popen([s], shell=True)
I am using a file chooser dialog in my real program, but this causes the
exact same problem.
When VideoLAN player opens it gives this message:
Unable to open '"C:\Documents'
Unable to open 'and'
Unable to open 'Settings\bk\Documents\Resources\WORKINPR2001.mpeg"'
However when I print the string I get
vlc "C:\Documents and Settings\bk\Documents\Resources\WORKINPR2001.mpeg"
:sout=\#duplicate{dst=display,dst=std{access=udp,mux=ts,dst=224.0.0.0:1234}}
:sout=#duplicate{dst=display,dst=std{access=udp,mux=ts,dst=224.0.0.0:1234}}
Which works fine when I paste it on a command line.
Is there something I am missing about spaces in the path on windows?
(BTW if I use
f=os.popen(s, 'w')
It works fine, but that leaves me with a blocking call, and I really want a
subprocess)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.python.org/pipermail/python-win32/attachments/20061018/69571f6d/attachment.htm
More information about the Python-win32
mailing list