Newbie subprocess question

News123 news1234 at free.fr
Fri Nov 26 05:11:10 EST 2010


On 11/26/2010 12:18 AM, Tim Harig wrote:
> On 2010-11-25, Hugo Léveillé <hugol at fastmail.net> wrote:
>> I'm starting various application using subprocess.Popen without any
>> problem. The problem is with application inside "Program Files". It
>> looks like subprocess is stopping the application string after
>> "Program". I tried puting the programe name inside double quote like
>> '"Program File*..."'. No luck.
> 
> Not sure you you are having issues.
> 
> 	subprocess.Popen("C:\\Program Files\\Vim\\vim73\\gvim.exe")
Above line should work.


In order to avoid the double backslashes (such, that you can just copy
paste from the windows explorer or from a
command line shell you could additionally prefix the string with r.

 	subprocess.Popen(r"C:\Program Files\Vim\vim73\gvim.exe")

copying and pasting reduces the risk of typos




More information about the Python-list mailing list