How to call application in the background with subprocess.call

John Bokma john at castleamber.com
Fri Apr 9 13:20:32 EDT 2010


Kushal Kumaran <kushal.kumaran+python at gmail.com> writes:

> On Thu, Apr 8, 2010 at 7:39 PM, jorma kala <jjkk73 at gmail.com> 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



More information about the Python-list mailing list