May 2019
Beginner
528 pages
29h 51m
English
Various types of exceptions can occur when you work with files, including:
A FileNotFoundError occurs if you attempt to open a non-existent file for reading with the 'r' or 'r+' modes.
A PermissionsError occurs if you attempt an operation for which you do not have permission. This might occur if you try to open a file that your account is not allowed to access or create a file in a folder where your account does not have permission to write, such as where your computer’s operating system is stored.
A ValueError (with the error message 'I/O operation on closed file.') occurs when you attempt to write to a file that has already been closed.
Let’s revisit two exceptions that you ...
Read now
Unlock full access