Soren Aalto on Thu, 1 Jun 2000 10:05:29 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

python/threads/tkinter


Do these work together?  I have to admit, I am
struggling more than I like with getting threads
to work in Python.

Basic problem -- Tkinter apps always involve
creating widgets, then calling root.mainloop()
to handle the eventloop.  What's the best way
of handling other input sources?  I want to write
a quick thing just to generate an interactive
plot of stuff read from files in /proc to get
a feel for this.

My approach had been -- create a separate thread
that reads the data, and calls a method of the
widget containing class that updates the plot/
canvas widget.

But once I call mainloop, the thread that
should have started doesn't seem to.  And it
does seem to run when I take out the call to
root.mainloop()

--
Soren Aalto <soren@xxxxxxxxxxxxxxx>
Internet guy, University of Zululand 
If Bill Gates had a nickle for every time
Windows crashed...oh wait, he does.