Module 9 - Files
Quick summary description
Before the week begins
Major Topics
Materials
Due This Week:
Graded This Week
Student Difficulty
Module 9 - Staff Meeting
Lessons
Lesson 44- Filesystems
Summary: Your computer has a File System that allows you to navigate, open, and edit files. These files are organized so that programs can open them using their address.
Learning Objectives:
- Navigate a file system using the command line
- Identify the path of a file
Activities:
- Lesson: Filesystem
- Quiz: Filesystem
Misconceptions: None listed so far
Lesson 45- Files
Summary: Once opened, data can be read from files in the program.
Learning Objectives:
- Define the term File
- Explain the difference between a File and a String
- Properly open and close a file using the With block
- Differentiate between a File, it’s name, it’s path, and it’s handle
- Read an entire file into memory
- Read a file using line by line iteration
Activities:
- Lesson: Files
- Quiz: Files
- Programming: Files
Misconceptions:
- Students get confused about the three ways to traverse a file (.read, .readlines, and using the file object as an iterator)
Lesson 46- Modules
Summary: Modules are a collection of functions and code that are shareable with other coders. Every time you create a Python program, you are actually creating a module. There are many modules out there.
Learning Objectives:
- Define the term “Module”
- Write code that imports a module
- Write code that uses functions defined in an external module
- Create a module
Activities:
- Lesson: Modules
- Quiz: Modules
- Programming: Modules
Misconceptions:
- Students try to combine the two styles of importing in incorrect ways (e.g., after “import math” they write “log” instead of “math.log”)
Summary: Files are often organized according to a particular format, which can make it much easier to access the data inside.
Learning Objectives:
- Define the term “File Format”
- Compare and contrast the JSON format with a basic text format
- Use a named parameter to call a function
Activities:
- Lesson: File Formats
- Quiz: File Formats
- Programming: File Formats
Misconceptions: None listed so far
Lesson 48- Web Data
Summary: Requests is the name of a powerful module for quickly and easily retrieving data from the internet. Accessing web-based data is one of Python’s great strengths and has many practical applications in real life.
Learning Objectives:
- Retrieve structured data from a URL algorithmically using Requests
- Retrieve data from a web page algorithmically using Requests
- Extract data from an HTML page using BeautifulSoup
- Extract data from a string using Regexes
- Identify practical applications of downloading data from the internet
- List hazards of using data through the web.
Activities:
- Lesson: Web Data
- Quiz: Web Data
- Programming: Web Data
Misconceptions:
- Students attempt to use “open” to get access to data in URLs and use “requests” to get access to local data.