Re: spawning a process with subprocess

2007-11-27 Thread Thomas Bellman
bhunter <[EMAIL PROTECTED]> wrote: > * The problem with the testcase, I believe, was the size of the file > and the output pipe filling up, as Nick suggested. When run on a > smaller file, with Jordan's suggestions, it works fine. With a larger > file, it's necessary to do as Nick says. If the

Re: spawning a process with subprocess

2007-11-27 Thread bhunter
Wow, everyone. Great comments. Thanks so much! A few points on all of the above, just so I don't look too stupid: * The problem with the testcase, I believe, was the size of the file and the output pipe filling up, as Nick suggested. When run on a smaller file, with Jordan's suggestions, it wo

Re: spawning a process with subprocess

2007-11-27 Thread Ove Svensson
bhunter <[EMAIL PROTECTED]> writes: > Hi, > > I've used subprocess with 2.4 several times to execute a process, wait > for it to finish, and then look at its output. Now I want to spawn > the process separately, later check to see if it's finished, and if it > is look at its output. I may want

Re: spawning a process with subprocess

2007-11-27 Thread MonkeeSage
On Nov 27, 4:30 am, Nick Craig-Wood <[EMAIL PROTECTED]> wrote: > MonkeeSage <[EMAIL PROTECTED]> wrote: > > Couple of things. You should use poll() on the Popen instance, and > > should check it explicitly against None (since a 0 return code, > > meaning exit successfully, will be treated as a fa

Re: spawning a process with subprocess

2007-11-27 Thread Nick Craig-Wood
MonkeeSage <[EMAIL PROTECTED]> wrote: > Couple of things. You should use poll() on the Popen instance, and > should check it explicitly against None (since a 0 return code, > meaning exit successfully, will be treated as a false condition the > same as None). Also, in your second example, you b

Re: spawning a process with subprocess

2007-11-26 Thread MonkeeSage
Hi Brian, Couple of things. You should use poll() on the Popen instance, and should check it explicitly against None (since a 0 return code, meaning exit successfully, will be treated as a false condition the same as None). Also, in your second example, you block the program when you call readline

Re: spawning a process with subprocess

2007-11-26 Thread bhunter
On Nov 26, 3:05 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > bhunter schrieb: > > > > > On Nov 26, 1:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > >> bhunter schrieb: > > >>> Hi, > >>> I've used subprocess with 2.4 several times to execute a process, wait > >>> for it to finish, and

Re: spawning a process with subprocess

2007-11-26 Thread Diez B. Roggisch
bhunter schrieb: > On Nov 26, 1:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: >> bhunter schrieb: >> >> >> >>> Hi, >>> I've used subprocess with 2.4 several times to execute a process, wait >>> for it to finish, and then look at its output. Now I want to spawn >>> the process separately, la

Re: spawning a process with subprocess

2007-11-26 Thread bhunter
On Nov 26, 1:50 pm, "Diez B. Roggisch" <[EMAIL PROTECTED]> wrote: > bhunter schrieb: > > > > > Hi, > > > I've used subprocess with 2.4 several times to execute a process, wait > > for it to finish, and then look at its output. Now I want to spawn > > the process separately, later check to see if i

Re: spawning a process with subprocess

2007-11-26 Thread bhunter
> > This is just the way I do it...as I said, there are probably some > other people in the group who will have other opinions. By the way, > your statement "I was hoping not to have to avoid that" means that you > hoped to use threading...which I think is contradictory to what you > meant. > > Mik

Re: spawning a process with subprocess

2007-11-26 Thread Diez B. Roggisch
bhunter schrieb: > Hi, > > I've used subprocess with 2.4 several times to execute a process, wait > for it to finish, and then look at its output. Now I want to spawn > the process separately, later check to see if it's finished, and if it > is look at its output. I may want to send a signal at

Re: spawning a process with subprocess

2007-11-26 Thread kyosohma
On Nov 26, 12:27 pm, bhunter <[EMAIL PROTECTED]> wrote: > > I've read that this sort of thing can be a pain. I'm sure someone will > > post and have other views though. I have had some success using > > Python's threading module though. There's a pretty good walkthrough > > here (it uses wxPython i

Re: spawning a process with subprocess

2007-11-26 Thread bhunter
> I've read that this sort of thing can be a pain. I'm sure someone will > post and have other views though. I have had some success using > Python's threading module though. There's a pretty good walkthrough > here (it uses wxPython in its example): > > http://wiki.wxpython.org/LongRunningTasks >

Re: spawning a process with subprocess

2007-11-26 Thread kyosohma
On Nov 26, 10:54 am, bhunter <[EMAIL PROTECTED]> wrote: > Hi, > > I've used subprocess with 2.4 several times to execute a process, wait > for it to finish, and then look at its output. Now I want to spawn > the process separately, later check to see if it's finished, and if it > is look at its ou