pygtk and long running process

Daniel Cer Daniel.Cer at gmail.com
Sun Apr 24 21:46:52 EDT 2005


Daniel Cer wrote:
> Robert wrote:
> 
>> I have a command line app that can take up to 20 minutes to complete and
>> every minute or so updates it's status (spits it out to console).  I am
>> writing a front end for this app in python/gtk and was wondering what
>> command I use to a) invoke the command and b) how to capture it's out put
>> and for instance update a text box.
> 
> 
> os.popen() will probably do what you want.
> 
> e.g.:

(....)

As for the latter part of (b)....

I don't know much about pygtk, but I imagine you should be able to put 
the code that monitors the external program in a thread, and then 
whenever you get some new status information update the text box.

-Dan



More information about the Python-list mailing list