DarkBlue <[EMAIL PROTECTED]> writes:
> I am trying to write a script (python2.3) which will be used 
> with linux konqueror to retrive 2 webpages alternatively every 2 minutes.
>
> My question is how can I send alternative args (the url)
> to the same invocation of konqueror which I started with
>
> def pipedreams(program, *args):
>         pid = os.fork()
>         if not pid:
>           os.execvp(program, (program,) +  args)
>           return os.wait()[0]  
>
> pipedreams("konqueror",url1)
>
> Obviously every time I call pipedreams I would open a new instance
> which is exactly what I do not want.

No, that's not at all obvious. Some browsers will notice the
previously running instance, and tell it to load the page - basically
doing exactly what you want. Some take special flags to do that.

The webbrowser module abstracts all these differences out for
you. Since it has support for Konquerer, your code should look like this:

# Untested - I don't have Konquer installed.

import webbrowser
webbrowser.open(url1)

You may have to set the BROWSER environment variable to get it to find
Konquerer.

        <mike
-- 
Mike Meyer <[EMAIL PROTECTED]>                  http://www.mired.org/home/mwm/
Independent WWW/Perforce/FreeBSD/Unix consultant, email for more information.
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to