[pygtk] Asynchronous access at output of os.popen() call
Vláďa
vladovi at atlas.cz
Wed Aug 20 22:14:31 WST 2008
Pádraig Brady <P at draigBrady.com> wrote:
> A.T.Hofkamp wrote:
> > Pádraig Brady wrote:
> >> togix wrote:
> >>> Hi,
> >>> I'm working on a GUI in PyGTK that
> allows to insert some parameters and then to call a program (written in C) using
> the os.popen() function.
> >>>
> >>> The thing that I want to do is redirect
> the standard output of the called program into a gtk.TextView() box [b]in
> runtime[/b],
> >>> so to show the lines when they come out
> in a asynchronous way, not all the end of execution.
> >> Yes there are 2 issues here.
> >> The first is that os.popen() doesn't return
> until the subprocess is finished.
> >
> > This is not true at my Linux platform:
>
> Sorry you're right.
> I meant that iterating over the os.popen()
> file object will not complete until the subprocess has finished.
>
> Pádraig.
I'm using the subprocess2.py module from http://code.activestate.com/recipes/440554/. It works perfectly for me in Windows. I haven't tried it on Linux yet but it should work too. If anyone would need a usage example, I can provide it.
Regards,
Vlada
More information about the pygtk
mailing list