Re: How to call application in the background with subprocess.call

Discussion in 'Python' started by Kushal Kumaran, Apr 8, 2010.

  1. On Thu, Apr 8, 2010 at 7:39 PM, jorma kala <> wrote:
    > Hi,
    >
    > I'd like to call an external application (firefox) from a python program (a
    > PyQT GUI), but I want the external application to run in the background, I
    > mean I do not want my python calling program to wait till the external
    > subprocess terminates.
    > I've tried this:
    >
    > call(["firefox", "http://www.python.org"])
    >
    > but my PyQT interface freezes until I terminate Firefox.
    > Is there any parameter I need to use with call so that the python calling
    > program doesn't wait for the termination of the subprocess?
    >


    Use subprocess.Popen instead of directly using subprocess.call.

    --
    regards,
    kushal
     
    Kushal Kumaran, Apr 8, 2010
    #1
    1. Advertising

  2. Kushal Kumaran

    John Bokma Guest

    Kushal Kumaran <> writes:

    > On Thu, Apr 8, 2010 at 7:39 PM, jorma kala <> wrote:
    >> Hi,
    >>
    >> I'd like to call an external application (firefox) from a python program (a
    >> PyQT GUI), but I want the external application to run in the background, I
    >> mean I do not want my python calling program to wait till the external
    >> subprocess terminates.
    >> I've tried this:
    >>
    >> call(["firefox", "http://www.python.org"])
    >>
    >> but my PyQT interface freezes until I terminate Firefox.
    >> Is there any parameter I need to use with call so that the python calling
    >> program doesn't wait for the termination of the subprocess?
    >>

    >
    > Use subprocess.Popen instead of directly using subprocess.call.



    Or (maybe) better, use the webbrowser module.
    http://docs.python.org/release/2.5.2/lib/module-webbrowser.html

    --
    John Bokma j3b

    Hacking & Hiking in Mexico - http://johnbokma.com/
    http://castleamber.com/ - Perl & Python Development
     
    John Bokma, Apr 9, 2010
    #2
    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. Jim
    Replies:
    2
    Views:
    471
  2. David Pratt
    Replies:
    0
    Views:
    276
    David Pratt
    Apr 7, 2008
  3. David Pratt
    Replies:
    0
    Views:
    418
    David Pratt
    Apr 7, 2008
  4. danshumaker

    Background subprocess help?

    danshumaker, May 23, 2009, in forum: Python
    Replies:
    1
    Views:
    877
    Piet van Oostrum
    May 24, 2009
  5. hiral
    Replies:
    2
    Views:
    627
    Jean-Michel Pichavant
    May 5, 2010
Loading...

Share This Page