Python exceptions: call same function for any Exception -
Notice in the code below that foobar () is said to be that if there is any exception throws up. Is there any way to do this without using the same line in every exception? Except for foo (): (except for foo (): try: foo () except bar foobar (error type B): except for falf () (pistol): print 'you Swine flu has caught! ' Except Foobar (): foobar ()
success = try the wrong : Foo () Success = Except the truth: Except bar: (b): Except Baaz () (C): Bay () Finally: If not success: foobar ()
Comments
Post a Comment