MIS 304 Lecture Notes - Lecture 11: Newline

44 views3 pages

Document Summary

Output file: a file that data is written to. Input file: a file from which data is read. 3 steps that must be taken when a file is used by a program. Opening in a different location: file_variable = open(r"path", mode) Reading entire contents of a file: variable = file_variable. read() Reading a single line of file: variable = file_variable. readline() File cannot be changed or written to. Numbers must be converted to strings before they can be written to a file. Creates file if it does not exist. Appends data to end if it does. Prevents loss of data because it forces data in the buffer to be written to the file. Text file: contains data that has been encoded as text. Binary file: contains data that has not been converted to text. Sequential access file: access data from the beginning to end of the file.

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