Unit 10 · Lesson 6
Build the idea
Start with the concept and its key vocabulary.
A file stores data beyond the current program run. It must be opened before reading or writing and closed afterwards. ERL uses open, readLine, writeLine, close, endOfFile and newFile. Python opens a file with a mode: 'r' reads and 'w' writes a new or replaced file. Python write does not automatically add a line break, so add \n when a complete line is required.
A named collection of data stored outside the program's variables.
Prepare a file for reading or writing and obtain a file handle.
The program value used to access an open file.
The position after the final item in a file.