IOError occured. No such file or directory
The note always shows up.
# -*- coding:utf-8 -*-try:
file = open('log.log', 'rb')
except IOError as e:
print"IOError occured. {}".format(e.args[-1])
raise e
except EOFError as e:
print"EOFError occured. {}".format(e.args[-1])
raise e
finally:
print"The note always shows up."
IOError occured. No such file or directory
The note always shows up.
---------------------------------------------------------------------------
IOError Traceback (most recent call last)
<ipython-input-6-d7ccfce08e95> in <module>()
4 except IOError as e:
5 print "IOError occured. {}".format(e.args[-1])
----> 6 raise e
7 except EOFError as e:
8 print "EOFError occured. {}".format(e.args[-1])
IOError: [Errno 2] No such file or directory: 'log.log'