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. Advertising

  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. Advertising

  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. Advertising

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. Rob Newman
    Replies:
    0
    Views:
    1,022
    Rob Newman
    Jun 16, 2009
  2. hiral
    Replies:
    2
    Views:
    627
    Jean-Michel Pichavant
    May 5, 2010
  3. Alex Naumov
    Replies:
    0
    Views:
    99
    Alex Naumov
    May 23, 2013
  4. Peter Otten
    Replies:
    0
    Views:
    104
    Peter Otten
    May 23, 2013
  5. Alex Naumov
    Replies:
    0
    Views:
    108
    Alex Naumov
    May 23, 2013
Loading...

Share This Page