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

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -