我想做以下事情:
我该怎么做?
答案 0 :(得分:3)
您可以在try
循环中放置except
- else
- while
块来执行此操作
while True:
try: # put your code below
...
...
except: #Exception was raised, else will not be executed
...
else: #Script succeeded without errors
...
break