[Tutor] Really miss the C preprocessor!!
gilcosson_2000 at yahoo.com
Sat Mar 6 06:13:49 CET 2010
I have some code to perform an exponential backoff. I am interacting with a few different web services. Checking for a specific Exception and then re-invoking the failed call after waiting a bit. I don't want to code the backoff in ten different places. Really miss the C pre-processor.
I am tempted to try something like the following, but I understand that eval should be a last resort.
Any pythonic best practice for this situation?:
from time import sleep
from random import randint
currentiteration = currentiteration+1
360 620 0431
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor