14.0: Introduction
( \newcommand{\kernel}{\mathrm{null}\,}\)
Figure 14.1 credit: Larissa Chu, CC BY 4.0
Programming often involves reading information from files and writing information into files. This chapter begins by introducing how to read from and write into files in Python.
Reading and writing files can lead to exceptions when the file specified cannot be found. There are many other situations in which exceptions can occur. The second half of the chapter introduces exceptions and how to handle exceptions in Python.