Redrawing GUI while in a for loop

Marco Terzuoli marco.terzuoli at libero.it
Thu May 20 16:36:04 EDT 2004


Hi,
I am making a program which has got some GUI. I need a timer in it which
performs some kind of operations. What I am doing now is something like

while 1:
        sleep(1)
        do_stuff()

But this way I cannot interact with the GUI since the program is only run
within the while loop. Is there any way to solve the problem either with a
function that temporarily passes control to the OS (something like DoEvents
in Visual Basic) or with a timer instruction which regularly calls a
function I define?

Thanks
Marco



More information about the Python-list mailing list