I\'m trying this simple code, but the damn break doesn\'t work... what is wrong?
while True:
for proxy in proxylist:
try:
h = urllib.urlo
You can use a custom exception and then catch it:
exit_condition = False
try:
if exit_conditon is True:
raise UnboundLocalError('My exit condition was met. Leaving try block')
except UnboundLocalError, e:
print 'Here I got out of try with message %s' % e.message
pass
except Exception, e:
print 'Here is my initial exception'
finally:
print 'Here I do finally only if I want to'