event异步回调
2017-09-24 本文已影响2人
jacke121
importthreading
importtime
defdo(event):
print('start')
time.sleep(1)
event.set()
print('event set')
event_obj = threading.Event()
t = threading.Thread(target=do,args=(event_obj,))
t.start()
print("no event result")
event_obj.wait()
# for i in range(10):
print("event result")