Re: Newbie subprocess question

2010-11-26 Thread News123
On 11/26/2010 12:18 AM, Tim Harig wrote:
 On 2010-11-25, Hugo Léveillé hu...@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(rC:\Program Files\Vim\vim73\gvim.exe)

copying and pasting reduces the risk of typos

-- 
http://mail.python.org/mailman/listinfo/python-list


Newbie subprocess question

2010-11-25 Thread Hugo Léveillé
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.

How can I start a app inside this folder ?

Thanks


-- 
  Hugo Léveillé
  TD Compositing, Vision Globale
  hu...@fastmail.net

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie subprocess question

2010-11-25 Thread Tim Harig
On 2010-11-25, Hugo Léveillé hu...@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)
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie subprocess question

2010-11-25 Thread MRAB

On 25/11/2010 22:56, Hugo Léveillé 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.

How can I start a app inside this folder ?


Try passing the application path and its arguments (if any) as a list
like this:

subprocess.Popen([app_path, arg1, arg2])
--
http://mail.python.org/mailman/listinfo/python-list


Re: Newbie subprocess question

2010-11-25 Thread Dave Angel

On 01/-10/-28163 02:59 PM, Hugo Léveillé 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.

How can I start a app inside this folder ?

Thanks


How about you show us exactly what you are doing, and just what you mean 
by no luck ?  You also should tell us what version of Python you're 
running, and mention that you're on Windows (presumably, but not 
necessarily).


Perhaps you're using shell=True, perhaps you have an executable in the 
root directory called  c:\program.exe,  Perhaps you're passing 
arguments, but not putting them in separate list items.  Who knows?


DaveA




--
http://mail.python.org/mailman/listinfo/python-list