def run(): ok = 0 stop = False while not stop: ok = n2.step(1) if ok == 0: for e in when_expr: stop = stop or e() else: stop = True return ok
def step(n=1): return n2.step(n)