File I/O#
Lecture#
![]() |
File I/O in Python |
Core Concepts#
Before we start loading data files in Python, let’s talk more about how programming languages handle creating, reading, and writing files.
From Busbee and Braunschweig’s “File Input and Output,” in Programming Fundamentals:
"A computer file is a computer resource for recording data discretely in a computer storage device. Just as words can be written to paper, so can information be written to a computer file.
"There are different types of computer files, designed for different purposes. A file may be designed to store a picture, a written message, a video, a computer program, or a wide variety of other kinds of data. Some types of files can store several types of information at once.
"By using computer programs, a person can open, read, change, and close a computer file. Computer files may be reopened, modified, and copied an arbitrary number of times."
To break that down:
Files store information
Files have different formats or types
Core file tasks (when working in a programming environment):
open,read,modifyorchange,close
