Tkinter Introduction
Tkinter Introduction
Tk inter library
Learning objectives
• Understand the GUI in python
• Learn the basic feature of tkinter GUI to include the
following
• How to create a window
• Window background, size and title
• Labels
• Data entry boxes
• Buttons
• Message boxes
• Place objectives
• Add images
What is Tkinter?
• Before we begin, you ought to know
that the Tkinter module (“Tk
interface”) is the standard Python
interface to the Tk GUI toolkit
from scriptics (it was formerly
developed by Sun Labs).
• Simply put, Tkinter consists of a
number of modules.
• The public interface is provided
through a number of Python modules.
To use Tkinter, all you need to do is to
import the Tkinter module:
• import tkinter import *
Create a window in python using tkinter
Create a window background colour, Title and size
Create a Label
The first string in the brackets is the title of the message box and, after the comma, the second
string is the message itself.
Use an if statement directly after a multiple choice text box to determine what happens:
Independent activity
Go to
https://www.csnewbs.com/python-1
1-gui
• Complete practise tasks 1 - 8