background process

Hi,

I'm working on a queuing program and have been able to make the gui and
have it work as I'd expected, but I'm running into trouble with having
the script keep doing something in between gui events. What I have is
two queues in listboxes with which I can manipulate items up and down as
well as move them from queue to queue. What I'd like to do is every
couple of seconds, regardless of user input, delete the top item from
each queue until everything is done.

The structure of my program is pretty simple, mostly I just need to know
where to put the instructions where they'll get executed repeatedly,
regardless of other things. I've attached the script so it'll be easier
to see what I'm doing.

Thanks in advance,

my_gui.py (12.1 KB)

ยทยทยท

--

Travis Smith
Unix Systems Manager
Tyco Electronics PCG
Logan, Utah
435-753-4700 x3030

travis wrote:

What I'd like to do is every
couple of seconds, regardless of user input, delete the top item from
each queue until everything is done.

If you want to have some action happen at regular intervals, then you need a wxTimer. Check the docs/demo for how to use it properly, but the basic idea is that it will send a special timer event at a specified interval. In that timer event's handler, you can then remove the top item of each queue, or whatever else needs done.

For other ways of making things happen that don't rely on regular GUI events, see
http://wiki.wxpython.org/index.cgi/LongRunningTasks -- this doesn't apply to your problem (as you've expressed it so far, at least), but it may give you some ideas about how to work with things that don't mesh well with the regular event loop.

Jeff Shannon
Technician/Programmer
Credit International