Timing in MacPython?

Luc Lefebvre lefebvre at medz.mcgill.ca
Wed Dec 15 09:03:30 EST 1999


In article <ventrego-18255C.22465014121999 at news.earthlink.net>,
ventrego at yahoo.com wrote:

> I'm trying to create a simple timer application - something like a 
> kitchen timer, just computerized.  However, I'm running into several 
> problems:
> 
> First,can I force TKinter update the window?  I've set up a label and a 
> button with TKinter textvariables, but the changes don't happen until 
> after my program returns to idle - in this case, after the time interval 
> has elapsed.  I'd like to have changes updated while the timer's waiting,
> so that the user knows everything's working correctly.
> 
> Second, is there an easy way to sound the system alert sound?   I'm 
> referring the one that people can choose in the Sound/Monitors & Sound 
> control panel.  It's possible to create a waveform and play it a la' the 
> morse.py demo program, but this seems excessively inelegant.
> 
> Finally, is there a non-blocking time-delay command?  I'm using 
> time.sleep(1), which is working well, but it stops all other processes 
> from executing.  Ideally, I'd like this timer to run in the background!
> If I was on a UNIX system, I'd use signals, which would be VERY easy,
> but I'm a Mac addict at heart. :)
> 
> Thanks for any help - 
> Michael

If TKinter is like Tk you would use "update" inside your loop.

-- 
***     Luc Lefebvre
NOTE:   if your reply via email
        please remove the z from my return address
***



More information about the Python-list mailing list