Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python wait

import time

def wait_until(somepredicate, timeout, period=0.25, *args, **kwargs):
  mustend = time.time() + timeout
  while time.time() < mustend:
    if somepredicate(*args, **kwargs): return True
    time.sleep(period)
  return False
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #python #wait
ADD COMMENT
Topic
Name
3+1 =