我想问一下如何进行故障转移,如下所示:
again = 1
start = 1
try:
def countthis():
for i in range (start,200):
again = i
print i
except:
print "Failure occured, I will try again"
start = again
countthis.run()
我想如果 for 函数在 i 的 try 中失败,它会从最新的 i 重新启动(而不是从 1 开始)