Computer Science 1026A/B Lecture Notes - Lecture 7: Exception Handling, Delimiter, Error Detection And Correction

57 views17 pages
terubarenuka and 39895 others unlocked
COMPSCI 1026A/B Full Course Notes
26
COMPSCI 1026A/B Full Course Notes
Verified Note
26 documents

Document Summary

: text files are commonly used to store information, they are the most portable" type of data. : examples of text files are files that are created with a simple text editor, such as windows. Notepad, and python source code and html files. :to access a file we must first open it! : to open a text file for reading, in the same directory as the program: use filename and r as arguments for the open () function . : use w to open a file for writing. If the file does not exist, an empty file is created. :when you are done processing a file, be sure to close the file using the close() method: infile. close() outfile. close() : if your program exits without closing a file that was opened for writing, some of the output may not be written to the disk file.

Get access

Grade+
$40 USD/m
Billed monthly
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
10 Verified Answers
Class+
$30 USD/m
Billed monthly
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
7 Verified Answers

Related Documents

Related Questions