Skip to content

Instantly share code, notes, and snippets.

@dakk
Created May 22, 2015 13:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dakk/994421f47bd45f0e1298 to your computer and use it in GitHub Desktop.
Save dakk/994421f47bd45f0e1298 to your computer and use it in GitHub Desktop.
Try done (fun(par)) Except retry
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