Running a timer for function which will be called later (python) -
def child_thread(i): global lock while true: try: lock.acquire() f1() f2() f3() : lock.release() thread1 = threading.thread(target=child_thread, args=(0,)) thread1.start()
here need timer f2 function called.were thread should wait time. dont want use sleep.
the function call after 30.0 seconds
from threading import timer def hello(): print "hello, world" t = timer(30.0, hello) t.start()
Comments
Post a Comment