Lesson 1.5 GUIs in Python

Lesson 1.5 GUIs in Python

The goal of this lesson is for students to conceive of any class of objects as an abstraction. Students will create a graphical user interface (GUI) with considerations of audience and accessibility. The lesson begins with an unplugged activity that generalizes the user interface topic of this lesson to the field of human-computer interaction. The remainder of the lesson is optional and used to differentiate the curriculum across different schools, depending on whether students entered the course having already learned some programming in earlier grades using Scratch, App Inventor, or other environments such that Lessons 1.1 and 1.2 are expedited or omitted.

In the lesson, students practice using an application programming interface (API) to learn methods that affect an object’s state. Students work with two APIs: the Tkinter Canvas for drawing and animation and the Tkinter toolbox of GUI widgets. Students are provided code for a simple GUI that implements a model-view-controller (MVC) pattern. Students will modify the elements of that pattern to suit their own needs. The lesson concludes with a problem in which students create a model-view-controller GUI using Scratch or Python. Strategies for documentation are reinforced, and Agile development is emphasized in the concluding problem.