Graphical User Interface
You will be used to using programs that have a graphical user
interface (GUI).
So far you have been writing programs that have a command line
interface (CLI).
Now you are going to learn how to develop programs with a GUI
using Python.
Python uses a library or add-on called Tkinter to create GUIs.
Task 1
Start a new Python program and enter the code shown below:
Creates a new text box
containing the text Computer.
Add the text box to the screen.
Task 2
Add these three lines of code to your program.
What do the
new lines do?
Task 3
Start a new Python program and enter the code shown below:
Adds a text entry box
to the screen.
This function is called when
the button is pressed.
Adds a
button to the
screen.
Task 4
Start a new Python program and enter the code shown below:
The inputted numbers are converted
to integers for the calculation.