D
DavidPorterHolt
Can anyone explain why the second print statement below (copied from
'Dive Into Python') generates a syntax error? As I understand
exceptions, the except block should handle the exception, and the
following print statement should execute normally.
fsock = open('/nothere')
except IOError:
print 'The file does not exist, exiting gracefully'
print 'This line will always print'
SyntaxError: invalid syntax
Any help will be much appreciated.
Thanks,
David Holt
(e-mail address removed)
'Dive Into Python') generates a syntax error? As I understand
exceptions, the except block should handle the exception, and the
following print statement should execute normally.
fsock = open('/nothere')
except IOError:
print 'The file does not exist, exiting gracefully'
print 'This line will always print'
SyntaxError: invalid syntax
Any help will be much appreciated.
Thanks,
David Holt
(e-mail address removed)