[wxPython] processes, threads, and external programs

Hi,

This is what I use, it will use an existing netscape process if it exists so it is much faster. Works fine though it won't shutdown with your app. Perhaps you could kill the process on exit.

-Mike
ps. look here for other options:
http://home.netscape.com/newsref/std/x-remote.html

···

---------------------------------------

filename = '/path/to/file.html'
cmd = "netscape -remote 'openURL(file:" + filename + ", newwinda)'"

print cmd
os.system(cmd)

--__--__--

Message: 7
Date: Sat, 31 Mar 2001 21:15:21 -0500 (EST)
Subject: Re: [wxPython] processes, threads, and external programs
From: Stephen Aichele <aichele@mindspring.com>
To: wxpython-users@lists.wxwindows.org
Reply-To: wxpython-users@lists.wxwindows.org

> [ You should teach your mail program how to word wrap... ]

Using Pygmy - didn't realize the lines weren't wrapping... ugh.

> What platform are you on?

Linux

>Which function(s) and parameters did you use to
> launch the other apps?

So far, I've tried just about everything in the OS module. I managed to
solve my original problem of getting the external apps to run separately
as children of the wxPython app; however, more problems have sprung up.

All I really want to do is to get an email client and a webbrowser to open
up on button clicks and to run as separate processes from the main app.
(i.e., I can still interact with the main app while the secondary programs are up.)

Ideally, when closing the main app, I'd like the secondary processes to either
1) shut down with it, or 2) stay up and running, but not interfere with the main app
when I try to restart it. I'm not sure how to make either of these things happen.

The webbrowser.py module looks promising (I need to upgrade to Python 2.0
though).

I just took a peek at wxExecute, but it's going to take me a while to figure out how
to get it to work.

I also just took a look at os.popen3 (someone suggested using it instead of wxExecute
in the archives) -

feeling bewildered at the moment...

-Stephen

thanks for the tip. I was originally using something similar, but now I'm using the webbrowser.py module. only dilemnas now are to 1) get the url to show up the first time the browser is opened (only opens to my homepage the first go for some reason) , and 2) figure out how to kill the newly-created process on exit.

best,
Stephen

···

On Mon, 02 Apr 2001 12:26:52 -0700, Mike Miller wrote:

Hi,

This is what I use, it will use an existing netscape process if it exists so it is much faster. Works fine though it won't shutdown with your app. Perhaps you could kill the process on exit.

-Mike
ps. look here for other options:
http://home.netscape.com/newsref/std/x-remote.html
---------------------------------------

filename = '/path/to/file.html'
cmd = "netscape -remote 'openURL(file:" + filename + ", newwinda)'"

print cmd
os.system(cmd)

> --__--__--
>
> Message: 7
> Date: Sat, 31 Mar 2001 21:15:21 -0500 (EST)
> Subject: Re: [wxPython] processes, threads, and external programs
> From: Stephen Aichele <aichele@mindspring.com>
> To: wxpython-users@lists.wxwindows.org
> Reply-To: wxpython-users@lists.wxwindows.org
>
>
> > [ You should teach your mail program how to word wrap... ]
>
> Using Pygmy - didn't realize the lines weren't wrapping... ugh.
>
> > What platform are you on?
>
> Linux
>
> >Which function(s) and parameters did you use to
> > launch the other apps?
>
> So far, I've tried just about everything in the OS module. I managed to
> solve my original problem of getting the external apps to run separately
> as children of the wxPython app; however, more problems have sprung up.
>
> All I really want to do is to get an email client and a webbrowser to open
> up on button clicks and to run as separate processes from the main app.
> (i.e., I can still interact with the main app while the secondary programs are up.)
>
> Ideally, when closing the main app, I'd like the secondary processes to either
> 1) shut down with it, or 2) stay up and running, but not interfere with the main app
> when I try to restart it. I'm not sure how to make either of these things happen.
>
> The webbrowser.py module looks promising (I need to upgrade to Python 2.0
> though).
>
> I just took a peek at wxExecute, but it's going to take me a while to figure out how
> to get it to work.
>
> I also just took a look at os.popen3 (someone suggested using it instead of wxExecute
> in the archives) -
>
> feeling bewildered at the moment...
>
> -Stephen
>

_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwindows.org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users