Hello,
Thats another excellent example thanks, however, the problem remains that I
am able to get a full report back from the child thread, but only when ithas been closed!
Iv tried to collect information using a timer, but that has not worked yet.
I’m missing something in my understanding here, I’m sure of it. The examples
Iv seen all do exactly what they claim, but their return values are alwaysreturned in one go when the child thread closes and the main thread remains
usable while the child is running.However I need the output from the child thread to be continually reported
to the main thread and so far Iv not seen any examples of this (exceptperhaps your module, which I have difficulty following anyway)
Can you perhaps give me a pointer to what I’m missing?
How are you reading from the processes out pipe? Just a read()?
Because this will block and not return anything until all output has been read or the pipe has been closed.You should also do a nonblocking read by only reading a little bit at a time.
i.e)
while not abort:
txt = proc.stdout.read(4096)
if txt:
wx.PostEvent(myhandler, MyEvent(type, id, value=txt)
OR wx.CallAfter(myTextCtrl.AppendText, txt)
else:
break
Note: instead of an arbitrary 4096 it would be better to check how much is available before reading each time. I leave this as an exercise to the reader.
Cody
···
On Fri, Mar 27, 2009 at 9:15 AM, MaxVK maximvonk@gmail.com wrote: