How to install Tkinter in Python — Python Tutorial
Tkinter is a standard library Python that used for GUI application. Tkinter with Python offers a straightforward and fast way to create GUI applications. Tk GUI works on the object-oriented approach which makes it a powerful library. Tkinter is widely available for all operating systems. It is pre-install in the Python. To work with the Tkinter, we must install the Python. In this tutorial, we will learn to install Tkinter.
Prerequisites
First, we must ensure that Python is installed or not in our system. If not, visit our tutorial ( https://www.javatpoint.com/how-to-install-python) install the Python properly.
Get Rajguleria’s stories in your inbox
Join Medium for free to get updates from this writer.
To create a user-friend GUI application, you should have basic knowledge of Python programming language.
Installing Tkinter in Windows
Tkinter comes with the Python installer. We just need to install Python from www.python.org, and it comes along with the Python. We don’t need to install it separately. Click on the checkbox of tcl/tk and IDE.
import tkinter as tk To check the Tkinter, we just need to import it in the text editor or IDE.
Now, we can access its functions to create widget. Let’s understand the following.
Example -
from tkinter import *
root = Tk()
# Code to add widget will go here……..
w = Label(root, width = "40", height = "15")
w.pack()
root.mainloop() Output:
All elements will be taken place in this Tkinter window.








