I'm working with python. I need to do an action after n seconds while another condition is true. I don't know if I should use a thread or only a timer:
start_time = time.time()
while shape == 4:
    waited = time.time() - start_time
    print start_time
    if waited >= 2:
        print "hello word"
        break
The shape is always change (the number of my finger in Frants of camera)
while it's 4 and after 2 seconds (like shape==4 and shape==4 and shape==4
many time) I need to do an action (here I use only print). How can I do this?
 
     
     
    