Created
May 22, 2015 13:14
-
-
Save dakk/994421f47bd45f0e1298 to your computer and use it in GitHub Desktop.
Try done (fun(par)) Except retry
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def try_for (fun, par, done, times): | |
while times > 0: | |
try: | |
a = fun (par) | |
done (a) | |
return | |
except: | |
times -= 1 | |
time.sleep (1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment