You are on page 1of 1

Solve all exercises in one file. File name ex: u10111_lab16.

py

Lab assignment #16


Exercises on GUI programming
16.1 Layout for calculator app
In Lecture 21 and 22, we talked about Python GUI programming using Tkinter framework.

In this laboratory, you need to create a layout for a simple calculator app as shown in Figure 1. It does not need to be
a fully functional calculator, but just a layout.

1. Use .grid() geometry manager to place all widgets


2. There are one Text widget and 16 Button widgets
3. Text widget should not be directly modifiable (i.e., the state should be disabled after each button click)
4. In Button declarations, you can use just the same function to pass as command. You can use lambda function
together. Refer to Figure 2 to see how to pass the argument using lambda function

Figure 1

Figure 2

You might also like