Should I use threads here?

Era Akost era_akost at yahoo.de
Wed Nov 28 10:25:31 EST 2001


Hi all,

My problem is the following. I have a program (no
source code) that takes some data from a file and
calculates some models. While executing, the program
outputs continually on the console. 
Now, I want to call this program within a Tkinter GUI.

I call the program (thanks to Steve Holden for the
answer) through popen2()

i, o = os.popen2('myProgram files')
for line in o.readlines():
    text.insert(END, line)
#text is a widget defined somewhere before.

But since I want to write the output on a GUI widget,
I saw that this happens only after  my program is
executed (I've should have known that). But sometimes
the programs runs for minutes, so in the meantime I
want some results beeing displayed in my GUI. Is that
something can be done with threads? If yes, how? I've
never used them before. Could someone give me an
example? (Python 2.01, Win NT)

thank you, 
Era

__________________________________________________________________

Gesendet von Yahoo! Mail - http://mail.yahoo.de
Ihre E-Mail noch individueller? - http://domains.yahoo.de




More information about the Python-list mailing list