โ† All lessons

Lesson 28 of 62 ยท about 14 minutes

Reading and Writing Files ๐Ÿ“„

Reading and Writing Files ๐Ÿ“„ Real programs persist data. The with statement opens a file and closes it automatically, even if an error happens. with open("notes.txt", "w") as f: f.write("First line\n") f.write("Second line\n") with open("notes.txt") as f: #โ€ฆ

The video for this lesson is out Friday 18 December at 6pm.

The video lesson is a free preview.

This lesson is part of Pythonaut Pro. The first two lessons are free, so you can start there and see how it works.

See the free lessons