A program that forgets everything when it stops is only half useful. Files are how it remembers: settings, notes, logs, results. This lesson shows the whole round trip for text files: open one, read it, write to it, add to it, and close it properly, with the with statement doing the closing for you.
More lessons in Complete Python Programming