Save this video — free

Lecture 13: File Reading 1

Professor Rosen · 1:06:25 · Watch on YouTube

Lecture 13: File Reading 1 Watch on YouTube →

Overview

Professor Rosen introduces Python file handling through text and binary file examples, then demonstrates how file locations, relative paths, and operating-system conventions affect whether Python can open a file. Using Project Gutenberg’s Treasure Island text and the Lab 7 Hurricane Irma tracker, the lecture covers `open()`, `read()`, `readlines()`, line-by-line iteration, UTF-8 encoding, and the `data/` subfolder paths needed to load CSV data.

Key takeaways

Chapters

0:00 Why Python File Reading Requires Knowing Where Files Are
4:00 Text Files, Binary Files, CSV, and Markdown
11:30 Lab 7: The Hurricane Irma Turtle Tracker
17:00 Creating Two Python Files in the Same Folder
22:00 Python’s `open()` Compared with Java and C File Reading
32:00 Absolute Paths, Relative Paths, and Project Gutenberg
39:00 Downloading Treasure Island as a Plain-Text File
44:00 Fixing File-Not-Found Errors and Selecting File Modes
47:00 Reading an Entire File with `read()`
49:30 Using `readlines()` to Store File Lines in a List
54:00 Iterating Through a File and Counting Pirate Vocabulary
58:00 Unzipping Lab Files and Preserving the Archive Structure
1:03:00 Loading Hurricane Data from the `data/` Subfolder

Keep these chapters and the full searchable transcript in your own library.

Summary, takeaways, and chapters were generated by AI from the video's transcript and may contain errors. The video belongs to its creator, Professor Rosen.

Want the full transcript?

Save this video in YouTube Collector to get its complete searchable transcript, your own AI summaries, and a library that keeps every video you collect in one place.