CSC 161 Lecture Notes - Lecture 19: Eval, Newline, Word Processor

11 views2 pages

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.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents