En Fri, 13 Jun 2008 02:42:53 -0300, Alexnb <[EMAIL PROTECTED]> escribió:

I am wondering what is the best way to create a timer, like an alarm, once it
reaches a time, it triggers an event. I have a way of doing this but it
seems like it isn't good at all. If it helps at all I am using a Tkinter,
but that probably doesn't mean much.

Actually it *is* very important - such things are done in very different ways on different GUI libraries.

The way I was doing it was using a
while loop, and just saying while current time is not = to trigger time, do
nothing, and when it is, do event.

Doing so makes your application irresponsive (frozen) until the time elapses.
Use the "after" method; see <http://effbot.org/tkinterbook/widget.htm>

--
Gabriel Genellina

--
http://mail.python.org/mailman/listinfo/python-list

Reply via email to