getting a thread out of sleep

mark rkmr.em at gmail.com
Tue Feb 20 23:08:43 EST 2007


Right now I have a thread that  sleeps for sometime and check if an
event has happened and go back to sleep. Now instead I want the thread
to sleep until the event has occured process the event and go back to
sleep. How to do this?
thanks
mark


class eventhndler(threading.Thread):
    def __init__(self):
        threading.Thread.__init__(self)

    def run(self):
        while True:
            time.sleep(SLEEPTIME)
            ''''do event stuff'''



More information about the Python-list mailing list