Defining Clean-Up Actions : finally « Statement « Python Tutorial






try:
     raise KeyboardInterrupt
finally:
     print 'Goodbye, world!'








3.11.finally
3.11.1.Using finally clauses.
3.11.2.Defining Clean-Up Actions
3.11.3.The finally clause will execute, whether there was an error encountered or not.