CSC 161 Lecture Notes - Lecture 19: Eval, Newline, Word Processor
Document Summary
# a program to calculate the value of some change in dollars. This is exactly the same thing as embedding \n in print statements: remember, these special characters only affect things when printed. The process of opening a file involves associating a file on disk with an object in memory: we can manipulate the file by manipulating this object, read from the file . When done with the file, it needs to be closed. Closing the file causes any outstanding operations and other bookkeeping for the file to be completed: in some cases, not properly closing a file could result in data loss. Reading a file into a word processor file opened contents read into ram file closed changes to the file are made to the copy stored in memory, not on the disk. Working with text files in python associate a disk file with a file object using the open function.