CSE 1010 Lecture Notes - Lecture 25: Mkdir, Newline, Empty String

26 views4 pages
WEEK 15 - LECTURE 25 - FILES
A file is a collection of data or information that is stored in secondary device.
We usually use files for storing data which can be processed by our program.
Files are used to store data permanently.
There are two types of files:
text files (contain ASCII)
binary files (contain non-ASCII, audio, video, photo)
Python provides basic functions and methods necessary to manipulate files by default.
Before you can read or write a file, you have to open a file using Python's built-in
open() function.
open() returns a file object, and is most commonly used with two arguments:
filename and mode
fileobject = open(filename, mode)
Unlock document

This preview shows page 1 of the document.
Unlock all 4 pages and 3 million more documents.

Already have an account? Log in
jadetortoise401 and 55 others unlocked
CSE 1010 Full Course Notes
84
CSE 1010 Full Course Notes
Verified Note
84 documents

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