CSC 226

CSC 226 logo

Software Design and Implementation


OPTIONAL T18: Using Tkinter to make a GUI

OPTIONAL Assignment T18 should be completed in pairs.

Objectives

  • Gain practice exploring how to make a GUI interface in Python using the Tkinter module


Assignment Specifics

This assignment is to be completed in teams in pairs.


Instructions for this Teamwork

This teamwork is designed to help you to explore using the Tkinter module to make a Graphical User Interface (GUI). Tkinter is perhaps the most popular Python module for GUI construction

First, download the following:

What you will see is a class called myTkinter. This class is used to create a Python window with a button, textbox, and label. When the button is pressed, a handler gets information from the textbox and then updates the label.

The main objective of this assignment is for you to learn to create a GUI in Python. I recommend you do something which makes you happy. You might consider doing one of the following:

  • Make a MabLib game
  • Make a guessing game where the computer thinks of a number between 1 and 10 and the user has to keep guessing until they find the correct number OR make a guessing game where the user thinks of a number between 1 and 10 and the computer has to keep guessing until it finds the correct number.
  • Make a math tutorial for a child where random integers are displayed and the child has to determine their correct sum.
  • Anything else which uses a GUI.

Tkinter also has GUI widgets to make drop-down menus and scroll bars, display images, etc..You can learn more about using Tkinter at https://docs.python.org/2/library/tkinter.html


Copyright 2016 | http://cs.berea.edu/courses/CSC226/ | Licensed under a Creative Commons Attribution-Share Alike 3.0 United States License