Python, Tkinter, and Threading

Marc losnations at comcast.net
Mon Feb 17 22:17:13 EST 2003


Therefore, let's get concrete:
> what are the examples of "back-end processing" of most
> importance to you?  Database retrievals?  Invocations of
> external processes?  Long-running pure-Python methods?
> --

Nothing special really. I have several applications that all do different
things. Most interface with test equipment and manipulate them in various
ways. The user inputs the data and input files and the program goes off and
does it's business with status fed back to the gui. Of course in order to
maintain control and update the gui, all of these subordinate tasks need to
be spun off in separate processes to share time with the main gui thread.
Otherwise, the gui won't update until the very end.

Using the queue model, some of these tasks are fairly difficult to execute.
I haven't found any way yet to input any type of decision making into a
queue. So any type of decision making must be fed into functions that are
called from within the queue. This works will in some cases, but can be
difficult to balance the real-time execution, which the equipment depends
on, with the queue functionality which will always lag a bit. Therefore, I
have split most of my functions into bite size chunks that handle a little
at a time, but it is still cumbersome and difficult to get the timing down
correctly.

So is there some solution that I have missed or some easier way of going
about this? It just seems like there should be a gui solution out there
which does the obvious, controls the gui and allows normal operation of code
to continue in the background that it can interact with. In the meantime, I
just need to get my stuff working.

Thanks again,
Marc






More information about the Python-list mailing list