December 2015
Intermediate to advanced
416 pages
7h 15m
English
CHAPTER 19
![]()
Exceptions
When something goes wrong with your program, do you want to keep the user from seeing a red Python error message? Do you want to keep your program from hanging? If so, then you need exceptions.
Exceptions are used to handle abnormal conditions that can occur during the execution of code. Exceptions are often used with file and network operations. This allows code to gracefully handle running out of disk space, network errors, or permission errors.
Vocabulary
There are several terms and phrases used while working with exceptions. Here are the most common:
Exception: This term could mean one of two things. First, the condition ...
Read now
Unlock full access