How to use Thread in Tkinter Python Last Updated : 17 Dec, 2020 Comments Improve Suggest changes Like Article Like Report Prerequisite: Python GUI – tkintermultithreading Python offers multiple options for developing GUI (Graphical User Interface). Out of all the GUI methods, tkinter is the most commonly used method. It is a standard Python interface to the Tk GUI toolkit shipped with Python. Python with tkinter is the fastest and easiest way to create the GUI applications. Creating a GUI using tkinter is an easy task. While Creating a GUI there will be a need to do multiple work/operation at backend. Suppose we want to perform 4 operations simultaneously. The problem here is, each operation executes one by one. During execution of one operation the GUI window will also not move and this is why we need threading. Both implementation is given below which obviously will help understand their differences better. Without Threading Working without threads, makes the process delayed. Also, the window will not move until full execution takes place. Approach Create Normal Tkinter WindowAdd Button with command Execute Tkinter Program: Python3 # Import Module from tkinter import * import time from threading import * # Create Object root = Tk() # Set geometry root.geometry("400x400") def work(): print("sleep time start") for i in range(10): print(i) time.sleep(1) print("sleep time stop") # Create Button Button(root, text="Click Me", command=work).pack() # Execute Tkinter root.mainloop() Output: With Threading Approach Create Normal Tkinter WindowAdd Button with command for threading Execute Tkinter Program: Python3 # Import Module from tkinter import * import time from threading import * # Create Object root = Tk() # Set geometry root.geometry("400x400") # use threading def threading(): # Call work function t1=Thread(target=work) t1.start() # work function def work(): print("sleep time start") for i in range(10): print(i) time.sleep(1) print("sleep time stop") # Create Button Button(root,text="Click Me",command = threading).pack() # Execute Tkinter root.mainloop() Output: Comment More infoAdvertise with us Next Article How to use Thread in Tkinter Python A abhigoya Follow Improve Article Tags : Python Python-tkinter Python-threading Practice Tags : python Similar Reads How to use threading in PyQt5? Prerequisite: PyQt5 and multithreading Multithreading refers to concurrently executing multiple threads by rapidly switching the control of the CPU between threads (called context switching). The Python Global Interpreter Lock limits one thread to run at a time even if the machine contains multiple 2 min read How to show webcam in TkInter Window - Python Python offers various modules for creating GUI applications, out of which, Tkinter lets users do various tasks inside their app. Thus, while creating a GUI app, have you ever felt the need to let the user open the camera on a specific condition? Don't know, how to achieve that. Continue reading this 4 min read What is Tkinter for Python? Tkinter is a standard Python GUI (Graphical User Interface) library that provides a set of tools and widgets to create desktop applications with graphical interfaces. Tkinter is included with most Python installations, making it easily accessible for developers who want to build GUI applications wit 2 min read How to create a new thread in Python Threads in python are an entity within a process that can be scheduled for execution. In simpler words, a thread is a computation process that is to be performed by a computer. It is a sequence of such instructions within a program that can be executed independently of other codes. In Python, there 2 min read Standard GUI Unit Converter using Tkinter in Python Prerequisites: Introduction to tkinter, Introduction to webbrowser In this article, we will learn how to create a standard converter using tkinter. Now we are going to create an introduction window that displays loading bar, welcome text, and user's social media profile links so that when he/she sha 12 min read Like