python-course.eu

Tkinter - the Python interface for Tk

By Bernd Klein. Last modified: 01 Feb 2022.

Introduction

We have often been asked: "Is there no Tk for Python?" or "Is Tkinter the same as Tk?" Of course, there is Tk for Python. Without Tk Python would be less attractive to many users. Tk is called Tkinter in Python, or to be precise, Tkinter is the Python interface for Tk. Tkinter is an acronym for "Tk interface".

Tk widgets

Tk was developed as a GUI extension for the Tcl scripting language by John Ousterhout. The first release was in 1991. Tk proved as extremely successful in the 1990's, because it is easier to learn and to use than other toolkits. So it is no wonder that many programmers wanted to use Tk independently of Tcl. That's why bindings for lots of other programming languages have been developed, including Perl, Ada (called TASH), Python (called Tkinter), Ruby, and Common Lisp.

Tk provides the following widgets:

It provides the following top-level windows:

Tk also provides three geometry managers:

Live Python training

instructor-led training course

Enjoying this page? We offer live Python training courses covering the content of this site.

See: Live Python courses overview

Enrol here

In this chapter

Page
Description
1. Labels in TkinterTkinter Labels - GUI Programming with Python: Simple Examples
2. Message widget in TkinterThe tkinter message widget under Python.
3. Buttons in TkinterTk tutorial: Using Buttons in Tkinter under Python.
4. Variable Classes in TkinterIntroducing Tkinter Variable Classes: StringVar, IntVar, DoubleVar and BooleanVar
5. Radio Buttons in TkinterThis chapter deals with Radiobuttons in Tk and Tkinter under Python.
6. Checkboxes in TkinterCheckboxes in Tkinter with example applications
7. Entry Widgets in TkinterTutorial on Tkinter: Communication with the User by using Entry Widgets
8. Canvas Widgets in TkinterTutorial on Tkinter: Canvas Widgets
9. Sliders in TkinterIntroduction to Sliders in Tkinter
10. Text Widget in TkinterText input for web applications with Text widgets in Tkinter
11. Dialogs in TkinterIntroduction to the standard dialogues of Tkinter.
12. Layout Management in TkinterLayout management under Tkinter and Python using pack, grid and place; GUI Programming with Python:
13. The Game of Life in PythonAn implementation of game of Life. The focus is on teaching Python and Tkinter. GUI Programming with Python: Not really a Game:
14. Bulls and Cows / Mastermind in TkinterImplemenation of Bulls and Cows, also known as Mastermind in Tk /Tkinter
15. Menus in TkinterDesigning and creating Menus in Tkinter GUI Programming with Python:
16. Events and Binds in TkinterTutorial and Introduction on Tkinter: Using Events and Binds, GUI Programming with Python: