I have tried to search but I couldn't find anything. However I probably just didn't word it right. In the book I am reading. A Python Book by Dave Kuhlman He writes a try:except statement to catch an IOError.
def test():
infilename = 'nothing.txt'
try:
infile = open(infilename, 'r')
for line in infile:
print line
except IOError, exp:
print 'cannot open file "%s"' % infilename
My question is what is the exp after IOError. what does it do and why is that there?