Guest User

Untitled

a guest
Mar 22nd, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. import time
  2.  
  3. def f(method,timeout,condition=False,*args,**kwargs):
  4. t_end=time.time() +timeout
  5. while time.time()<t_end:
  6. ret=method(*args,**kwargs)
  7. if condition:
  8. return ret
  9. return ret
  10.  
  11. def f2(a,b):
  12. print(a,b)
  13. def f3(a):
  14. print(a)
Add Comment
Please, Sign In to add comment