pygtk and long running process

Daniel Cer Daniel.Cer at gmail.com
Sun Apr 24 20:57:19 EDT 2005


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.:

import os

some_external_command = "ls"
prog_output = os.popen(some_external_command)
for status_line in prog_output:
         print status_line

-Dan



More information about the Python-list mailing list