What is Tkinter?

Tkinter is a cross-platform GUI framework that comes built into the Python standard library. Since it is a cross-platform framework, the same code can be used on any operating system, such as Linux, macOS, and Windows. Tkinter provides an object-oriented interface to the Tk GUI toolkit.

Other available GUI development platforms include wPython and JPython.

Why use Tkinter?

Compared to other available options, Tkinter is lightweight and easy to use. Therefore, it is the go-to choice for quickly building applications that can operate cross-platform and do not require a modern look.

The Tkinter module in Python allows us to build GUI applications in Python.

tkinter provides a variety of common GUI elements that can be used to build interfaces. These elementscalled widgets include buttons, menus, and various kinds of entry fields and display areas.

Install Tkinter

To install the tkinter module in Python 3.8, run the following command in the command line:

pip install tkinter

Importing Tkinter in Python source code

The following command imports the tkinter module in our Python source code:

import tkinter as tk

Free Resources