On 1 September 2014 02:31, Richard Dillon <dillo...@comcast.net> wrote:
>
>     except IOError:
>         print('An error occured trying to read the file.')
>
>     except ValueError:
>         print('Non-numeric data found in the file.')
>
>     except:
>         print('An error occured.')

Your other respondents have already said this, but I am going to emphasise it.

The above lines are bad. They do not help you, they only hinder you by
replacing useful information with dumb print statements that tell you
nothing useful. So delete them all!

'except' blocks should only be used when you know why the error
occurred, and they should contain useful extra code to either to
recover from the error or to work around it.

Those dumb print statements are not useful extra code. So delete them.
_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to