On Wednesday 13 May 2015 17:27, Christian Gollwitzer wrote: > A clean way to exit your script could be to raise an exception. It > should propagate to the toplevel and halt your script. However it is not > possible to back and resume the execution.
while True: try: run_script() # May raise TryAgain break except TryAgain: pass If you prefer to only retry a finite number of times: for i in range(10): try: run_script() # May raise TryAgain break except TryAgain: pass else: # break skips past the for...else block raise GiveUpError('too many failures') -- Steve -- https://mail.python.org/mailman/listinfo/python-list