Tag: tutorials
tkinter widgets
Tkinter has several widgets including:
- Label
- EditText
- Images
- Buttons (Discussed before)
In this article we will show how to use some of these Tkinter widgets. Keep in mind there’s a slight difference between Tkinter for Python 2.x and 3.x
Related course
Label
To create a label we simply call the Label() class and pack it. The numbers padx and pady are the horizontal and vertical padding.
from Tkinter import * |
EditText (Entry widget)
To get user input you can use an Entry widget.
from Tkinter import * |
Result:

Images
Tk has a widget to display an image, the PhotoImage. It is quite easy to load an image:
from Tkinter import * |
Result:

If you are new to programming Tkinter, I highly recommend this course.
GUI editor
An overview of Tkinter GUI editors can be found here: http://wiki.tcl.tk/4056