Save
...
Component 2
Python
Printing and Variables
Save
Share
Learn
Content
Leaderboard
Learn
Created by
Olu
Visit profile
Cards (16)
In Python, you don't have to just use a text display, you can use a
GUI
A GUI stands for a
Graphical User Interface
A GUI can be used (instead of a text display) to make
programs
that look
professional
Python's built-in GUI is named
tkinter
You can add images, labels, buttons and data entry boxes to develop
interactive programs
In this code, Firstly, you
import
the tkinter command - Secondly, you create a
variable
that
stores
the tkinter command
In this code below, the name of the variable is
window
Running this code creates a
blank window
When creating a window , you should set the
title
of the window that appears at the top , the
size
of the window and the
background colour
Here is an example of window that has been created - What is the title of the window? (Look carefully)
Graphical User Interface
Here is an example of a window that has been created - What is the title of the window (Look carefully) ?
My Program
The
window.title
command sets the title of the window
The
window.geometry
command sets the size of the window in pixels
In the window.geometry command , the first number is the
width
of the window - the second number is the
height
of the window
What is the height and width of the window that would be created by this code?
Height =
600
, Width =
350
The
window.configure
command sets the colour of the window background