python except try again code example
Example 1: how to print error in try except python
try:
# some code
except Exception as e:
print("ERROR : "+str(e))
Example 2: python try without except
try:
print('try to print this')
except:
pass #do nothing
Example 3: python try then change something and try again if fails
for i in range(0,100):
while True:
try:
# do stuff
except SomeSpecificException:
continue
break