if for some reason i want to repeat the same iteration how i can do it in python?
for eachId in listOfIds:
#assume here that eachId conatins 10
response = makeRequest(eachId) #assume that makeRequest function request to a url by using this id
if response == 'market is closed':
time.sleep(24*60*60) #sleep for one day
now when the function wake up from sleep after one day (market (currency trade market) is open) i want to resume my for loop from eachId = 10
not
from eachId = 11
, because eachId = 10
is not yet been processed as market was closed
, any help is highly appreciated thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…