Content deleted Content added
→Perl: expand entry using Matt Sergeant's presentation "Exception Handling in Perl" - |
Pineconius (talk | contribs) →[[Python (programming language)|Python]]: Added 'else' syntax |
||
Line 193:
except IOError:
print "Unable to open file"
except: # catch all exceptions
print "Unexpected error"
else: # executed if no exceptions are raised
finally: # clean-up actions▼
print "File write completed successfully"
▲finally: # clean-up actions, always executed
if f:
f.close()
|