Page 109 -
P. 109
3 files and exceptions
Dealing with errors
I always thought he was
exceptional...especially when it
comes to processing my files.
It’s simply not enough to process your list data in your code.
You need to be able to get your data into your programs with ease, too. It’s no surprise
then that Python makes reading data from files easy. Which is great, until you consider
what can go wrong when interacting with data external to your programs…and there
are lots of things waiting to trip you up! When bad stuff happens, you need a strategy for
getting out of trouble, and one such strategy is to deal with any exceptional situations
using Python’s exception handling mechanism showcased in this chapter.
this is a new chapter 73