Newbie subprocess question

Discussion in 'Python' started by Hugo Léveillé, Nov 25, 2010.

  1. 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
     
    Hugo Léveillé, Nov 25, 2010
    #1
    1. Advertisements

  2. Hugo Léveillé

    Tim Harig Guest

    On 2010-11-25, 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.


    Not sure you you are having issues.

    subprocess.Popen("C:\\Program Files\\Vim\\vim73\\gvim.exe")
     
    Tim Harig, Nov 25, 2010
    #2
    1. Advertisements

  3. Hugo Léveillé

    News123 Guest

    On 11/26/2010 12:18 AM, Tim Harig wrote:
    > On 2010-11-25, 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.

    >
    > 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
     
    News123, Nov 26, 2010
    #3
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pekka Niiranen

    Python 2.4: Subprocess and Cygwin question

    Pekka Niiranen, Nov 21, 2004, in forum: Python
    Replies:
    0
    Views:
    350
    Pekka Niiranen
    Nov 21, 2004
  2. Ernesto

    Terminating a subprocess question

    Ernesto, Mar 29, 2006, in forum: Python
    Replies:
    6
    Views:
    690
    Ernesto
    Mar 30, 2006
  3. Rob Newman
    Replies:
    0
    Views:
    1,314
    Rob Newman
    Jun 16, 2009
  4. Matt
    Replies:
    2
    Views:
    632
    Mike Kazantsev
    Jun 17, 2009
  5. hiral
    Replies:
    2
    Views:
    791
    Jean-Michel Pichavant
    May 5, 2010
  6. Chris Seberino
    Replies:
    2
    Views:
    693
    Chris Seberino
    Jun 15, 2010
  7. Jerry C.
    Replies:
    8
    Views:
    567
    Uri Guttman
    Nov 23, 2003
  8. Alex Naumov
    Replies:
    0
    Views:
    158
    Alex Naumov
    May 23, 2013
Loading...