June 2017
Beginner
352 pages
8h 39m
English
When we've finished writing, we should remember to close the file by calling the close() method:
>>> f.close()
Note that it's only after we close the file that we can be certain that the data we've written becomes visible to external processes. Closing files is important!
Also remember that you can no longer read from or write to a file after closing it. Attempts to do so will result in an exception.
Read now
Unlock full access