Fast-Paced Lesson Plan for Learning Practical Programming

Vivek Seth
3 min readFeb 15, 2016

--

The following is lesson plan for teaching practical programming. This guide aims to teach students programming skills that they can use to improve their everyday lives and compliment their existing interests.

1. Build Simple Website

Ask student to design a website that they would like to build. This can be a personal website, a website for a club/organization they are a part of, or anything else they would like to do.

Learning Goals:

  1. Intro to typing precise syntax
  2. intro to HTML, CSS
  3. Intro to a “programming” text editor like Sublime Text

2. Introduction to Python

Have student build simple programs that read input from STDIN, and output some modified string to STDOUT.

One example progression:

  1. script that prints out any line that was inputted.
  2. script that prints out “Hello “ + <input string>
  3. simple game that prints out “you win!” if student’s name is entered and “you lose” if anything else is entered
  4. script that adds two numbers (teaches parsing input, and basic error handling)

Learning Goals:

  1. accept input
  2. print output
  3. string manipulation
  4. intro to functions
  5. if-else control flow

3. Introduction to Backend Web Development

Build off of fundamentals of (accept input, modify it, output it), but in the context of a website. Have student use flask to create simple web-app. Use scripts from Intro to Python lesson as inspiration for dynamic pages student can create. Have student create HTML forms as interface for programs. Allow student to use HTML and CSS knowledge to design webpages.

Learning Goals:

  1. Introduction to Flask (python backend)
  2. Introduction to HTTP (get vs post)
  3. Introduction to HTML generation / templating
  4. What are the input sources for a backend web-app? (URL, Body)
  5. What can a web app output? (Body interpreted as HTML)

4. Build Simple Blog

Create pages for submitting a post, viewing a list of posts, and viewing an individual post. Posts are saved to an in-memory array or to a file. Talk about data persistence and why this approach would not work for a blog application that might need to be restarted (crashes, upgrades, server reboots, etc). If student has interest, introduce database/flat file serialization (pickle).

Learning Goals

  1. More experience accepting HTML form input
  2. More experience with dynamic HTML generation / templating
  3. Learn about data-persistance (databases and flat-file storage)

5. Introduction to Web Scraping

Build python app that will get a list of URLs to stream student’s favorite TV show when given season and episode number. To get links, scrape website like (http://watchepisodes1.com/). Use libraries like requests, and beautiful-soup to simplify HTTP requests and HTML parsing. Introduce concept of HTML node tree. Once student has built python program, convert into web app. Have student create HTML form for input, and create a page that outputs streaming links.

Learning Goals:

  1. Make HTTP requests
  2. Intro to HTML DOM
  3. Parse HTML syntax with libraries
  4. Advanced CSS selectors
  5. Possibly Regex

6. Advanced Web Scraping Project

Make a python app that downloads the raw video given a video streaming URL. Use Chrome’s developer tools to reverse engineer the HTTP requests a streaming site uses to download its video. The teacher should try this ahead of time to make sure student chooses a streaming site that is easy to reverse engineer. Don’t focus on the challenge of the reverse engineering (give student the HTTP request flow if needed). Have student focus on extracting relevant information and construction the proper HTTP requests to get the video stream. Once student has made python app, convert to web app. Possibly incorporate this project into first web-scraping project. Discuss OOP and polymorphism as a way to create and use diff video extractors for each diff streaming site.

Learning Goals:

  1. Make more advanced, chained HTTP requests
  2. Reverse engineer the series of HTTP requests a site makes
  3. Download video and save to file
  4. Intro to OOP and polymorphism

--

--