Lesson 9: File I/O
Outline:
- Questions?
- Goal: draw earthquakes from a file
- map image
- original code
- new dataset
- problem decomposition
- Aside: strings
- multi-line strings
s.split()- practice with strings: Exercise 1
- Reading from a file
- opening and reading files
- parsing
.csvfiles
Explore after class:
- Practice reading from a file
- practice reading data from a file: Exercise 2
- working with CSV data: Exercise 3
- Drawing earthquakes from a file, revisited
- Runestone:
What’s next
Upcoming assessments:
- Homework assignment 4 will be released later today
- Quiz 2 will be next Friday
What you should do now:
- The readings (see below)
- Submit Assignment 3 by 10pm today if you’re using a token
- Read the description of Assignment 4 this weekend and try to get started
Reading assignment (to be completed by the next class):
- Zelle sections 10.1–10.2.1 (pp. 297–311)