Re: asynchronous alarm

2008-02-24 Thread Alan Isaac
Paul Rubin wrote: > a = Event() > Thread(target=f, args=(a,)).start() > raw_input('hit return when done: ') > a.set() Simple and elegant. Thank you. Alan -- http://mail.python.org/mailman/listinfo/python-list

Re: asynchronous alarm

2008-02-23 Thread Paul Rubin
Alan Isaac <[EMAIL PROTECTED]> writes: > while True: > sys.stdout.write('\a') > sys.stdout.flush() > time.sleep(0.5) > > I want to add code to allow me to turn off this alarm and then > interact with the program in its new state (which the al

asynchronous alarm

2008-02-23 Thread Alan Isaac
Goal: turn off an audible alarm without terminating the program. For example, suppose a console program is running:: while True: sys.stdout.write('\a') sys.stdout.flush() time.sleep(0.5) I want to add code to allow me to turn off this alarm