

{"id":97887,"date":"2021-07-03T09:00:05","date_gmt":"2021-07-03T03:30:05","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=97887"},"modified":"2026-06-01T12:45:09","modified_gmt":"2026-06-01T07:15:09","slug":"create-countdown-timer-python","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/","title":{"rendered":"How to Create a Countdown Timer in Python"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:2556,&quot;href&quot;:&quot;https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1D5r64kzuSY5YO-a62ImYLBEEkAEEzawN\\\/view?usp=drive_link&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20260601071516\\\/https:\\\/\\\/drive.google.com\\\/file\\\/d\\\/1D5r64kzuSY5YO-a62ImYLBEEkAEEzawN\\\/view?usp=drive_link&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2026-06-02 07:02:29&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-05 16:31:02&quot;,&quot;http_code&quot;:200},{&quot;date&quot;:&quot;2026-06-09 11:14:47&quot;,&quot;http_code&quot;:200}],&quot;broken&quot;:false,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-09 11:14:47&quot;,&quot;http_code&quot;:200},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>A countdown timer is an ideal way to set targets to complete tasks eg keep a reminder for the oven etc. For large-scale applications such as industries, complex timers are used, which are custom-designed for various purposes such as triggering or flipping a switch after a delay of set time. We might have noticed a screensaver appearing on the desktop when left idle for sometime. This happens because of the timer which calculates our idle time. Similarly, automatic logging out of websites, OTP expiration, captcha expiration are all based on a timer which nullifies these password after the time period expires.<\/p>\n<h3>Python Countdown Timer Project:<\/h3>\n<p>We will create a simple countdown timer using python and display 2 notifications, one with the app created and another on the desktop to remind the user of the time elapsed. A good understanding of functions and Tkinter widgets to understand the code flow is ideal.<\/p>\n<h3>Project Prerequisites:<\/h3>\n<p>The python countdown timer project makes use of tkinter for GUI development, time module for creating a delay, and plyer to create desktop notifications. We make use of Tkinter, a built-in GUI library in python. To check its availability, import it:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">python\r\n&gt;&gt;&gt; import tkinter<\/pre>\n<p>If the library is installed, it will not show an error. In case an error appears, use the following command to install Tkinter on a Linux system:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">sudo apt-get install python3-tkinter<\/pre>\n<p>On Windows systems, reinstalling python will fix the issue. Time module is a built-in library and hence does not require any installation.<\/p>\n<p>Now, to install plyer please run below command using pip:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">pip install plyer<\/pre>\n<h3>Download Countdown Timer Python code:<\/h3>\n<p>You can download the source code for the Countdown Timer in the given link: <a href=\"https:\/\/drive.google.com\/file\/d\/1D5r64kzuSY5YO-a62ImYLBEEkAEEzawN\/view?usp=drive_link\"><strong>Countdown clock and timer<\/strong><\/a><\/p>\n<h3>Project File Structure:<\/h3>\n<p>There are many GUI libraries supported by python such as PyQT5, Kivy, Pyside2 etc. Tkinter is widely used by many developers and is easy for beginners to practice.<\/p>\n<p>Let\u2019s have a look at the steps to python countdown timer project:<\/p>\n<ol>\n<li>Importing modules: time, tkinter, and plyer<\/li>\n<li>Initializing the window and declaring the dimensions<\/li>\n<li>Defining functions for timer and placeholders<\/li>\n<li>Creating the user input interface<\/li>\n<li>Addition of a button to activate the timer<\/li>\n<\/ol>\n<p>Now let&#8217;s discuss the complete implementation in detail.<\/p>\n<p><em>Feel free to play with the values and change your input methods.<\/em><\/p>\n<h4>1. Importing necessary modules:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#DataFlair Guide for python Countdown Timer\r\n#Import necessary modules\r\nfrom plyer import notification\r\nfrom tkinter import messagebox\r\nfrom tkinter import *\r\nimport time\r\n<\/pre>\n<p><strong>Code Explanation:<\/strong><\/p>\n<ul>\n<li><strong>from plyer import notification:<\/strong> Plyer is a library that provides us with features to access bluetooth, wifi, battery details, send emails, gps and so on. Here we use notification to provide desktop notifications that get displayed on completion of python countdown timer.<\/li>\n<li><strong>from tkinter import messagebox:<\/strong> To display prompts, we use messagebox. It can create messageboxes for errors, to display information, ask questions etc.<\/li>\n<li><strong>From tkinter import *:<\/strong> We make use of Tkinter to create the user interface for the application. Tkinter is suitable for beginners and contains many widgets.<\/li>\n<li><strong>Import time:<\/strong> To create a delay between every second, we use time module<\/li>\n<\/ul>\n<h4>2. Initialising the window and declaring the dimensions:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Assign class and set dimensions of the interface\r\nwindow = Tk()\r\nwindow.geometry(\"300x200\")\r\nwindow.title(\"DataFlair - python Countdown timer and notification\")\r\n<\/pre>\n<p><strong>Code explanation:<\/strong><\/p>\n<ul>\n<li><strong>Window = Tk():<\/strong> Tkinter class, Tk() is assigned to an object window. We use this python countdown timer window to set components on the object such as text boxes, buttons etc<\/li>\n<li><strong>window.geometry():<\/strong> Specify the length and the breadth of the application window of the application using geometry.<\/li>\n<li><strong>window.title():<\/strong> Specify the title of the application. It is optional<\/li>\n<\/ul>\n<h4>3. Defining functions for timer and placeholders:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Remove the placeholders for every entry field based on click   \r\ndef h_click(event):\r\n       hour_entry.delete(0, 'end')        \r\ndef m_click(event):\r\n       min_entry.delete(0, 'end')\r\ndef s_click(event):         \r\n sec_entry.delete(0, 'end')\r\n<\/pre>\n<p><strong>Code explanation:<\/strong><br \/>\nThe placeholder functions are optional.<\/p>\n<ul>\n<li><strong>def h_click(event):<\/strong> We add a placeholder in the hours, minutes and seconds entry widgets. Hence when the user selects an entry widget, the placeholder is removed by deleting using entry_widget.entry(0,\u2019end\u2019), where 0 is the start of the placeholder character and \u2018end\u2019 denotes the end of the placeholder string. Similarly we extend this for minutes and seconds entry widget mouse clicks<\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Function to activate python countdown timer and show notifications once timer is up\r\ndef timer():\r\n   #Since we use placeholders, we check if the user entered an integer\r\n   try:\r\n       timer_time = int(hour_entry.get())*3600 + int(min_entry.get())*60 + int(sec_entry.get())\r\n      \r\n   except:\r\n       messagebox.showerror(message=\"Enter Valid Time\")\r\n   #The user cannot activate a timer with no time set\r\n   #To update the timer with every decreasing second and display a notification   \r\n   if timer_time &gt;0:\r\n       hour = 0\r\n       min = 0\r\n       sec = 0   \r\n       #If minutes is more than 60, it has to be set to the next hour\r\n       while timer_time &gt;= 0:\r\n           min, sec = divmod(timer_time,60)\r\n           if min &gt; 60:\r\n               hour, min = divmod(min,60)\r\n           #Set the declared variables with the new values to display               \r\n           hours.set(hour)\r\n           mins.set(min)\r\n           secs.set(sec)\r\n           #Sleep for 1 creates a delay of 1 second\r\n           time.sleep(1)  \r\n           #Update the changes on the window for every second\r\n           window.update()\r\n           #Decrement the timer value by 1\r\n           timer_time -= 1\r\n       #Create a desktop notification\r\n       notification.notify(\r\n           #Title of the notification,\r\n           title = \"TIMER ALERT\",\r\n           #Body of the notification\r\n           message = \"Hey amigo!\\nDid you do what you wanted to achieve? \\nIf not, try again with a new timer\",\r\napp_icon=\"\/home\/data-flair\/Downloads\/python-countdown-timer\/bell.ico\",\r\n           #Notification stays for 30 seconds\r\n           timeout  = 30,\r\n       )\r\n       #This notification is provided by tkinter with the created app\r\n       messagebox.showinfo(message=\"Timer Complete!\")<\/pre>\n<p><strong>Code explanation:<\/strong><\/p>\n<ul>\n<li><strong>def show_entry_fields():<\/strong> Declaration of function to invoke the timer.<\/li>\n<li><strong>timer_time:<\/strong> Set timer variable to contain the duration of the user timer in seconds. An hour contains 3600 seconds and a minute contains 60 seconds respectively. Thus we multiply hours with 3600 and minutes with 60, sum them up with the seconds<\/li>\n<li><strong>try&#8230;except :<\/strong> If a user enters an integer, the try block will not pass into the except block. This is because we set the hour, minute and second variables to integer data type. If the user gives a float number or it is left empty, a warning will pop up<\/li>\n<li><strong>If timer_time &gt; 0:<\/strong> A timer can start only when the user enters a minimum of 1 second<\/li>\n<li><strong>hour =0, min =0, sec =0:<\/strong> Declaration and initialisation of variables<\/li>\n<li><strong>while timer_time &gt;= 0:<\/strong> The loop decrements timer_time until it reaches 0 which marks the end of the time delay.<\/li>\n<li><strong>min, sec:<\/strong> Converting timer_time to minutes and seconds to display on the app. divmod(value, divisor) is a function that returns 2 values. The first value is the quotient of the division of timer_time by 60 and the second value is the remainder obtained during the division.<\/li>\n<li><strong>if min &gt; 60:<\/strong> If minutes is greater than 60, it is converted to hours and minutes using hour, min = divmod(min,60)<\/li>\n<li><strong>hours.set(hour), mins.set(min), secs.set(sec):<\/strong> Set the obtained hours, minutes and seconds to the integer variables declared outside the function.<\/li>\n<li><strong>time.sleep(1):<\/strong> Creates a delay of 1 second<\/li>\n<li><strong>timer_time -= 1:<\/strong> Decrement the timer_time by 1 to simulate the countdown timer<\/li>\n<li><strong>notification.notify():<\/strong> Creates a desktop notification. It takes the parameters: title &#8211; title of the alert, message &#8211; message of the notification, app_icon &#8211; (optional), a picture or icon, timeout &#8211; the duration after which the notification elapses. Replace the path for app_icon with your icon\u2019s absolute path.<\/li>\n<li><strong>messagebox.showinfo():<\/strong> A prompt box which serves as a notification in the python countdown timer app.<\/li>\n<\/ul>\n<h4>4. Creating the user input interface:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#Label for displaying the title of the app\r\n#position of the label or widget is set using pack().\r\n#pack defaults to centered alignment on a x row and y column coordinate\r\ntitle_label_1=Label(window,text=\"DataFlair-Countdown timer with notification\", font=(\"Gayathri\", 12)).pack()\r\ntitle_label_2 = Label(window, text=\"Put 0 in fields not of use\", font=(\"Gayathri\", 10)).pack()\r\n#Variables using which the timer is updated in the function\r\nhours = IntVar()\r\nmins = IntVar()\r\nsecs = IntVar()\r\n \r\n#To read user input for hours, minutes and seconds\r\nhour_entry=Entry(window,width=3,textvariable=hours,font=(\"Ubuntu Mono\",18))\r\nmin_entry=Entry(window,width=3,textvariable=mins,font=(\"Ubuntu Mono\",18))\r\nsec_entry=Entry(window,width=3,textvariable=secs,font=(\"Ubuntu Mono\",18))\r\n \r\n#Placeholder for the entry widgets\r\nhour_entry.insert(0,00)\r\nmin_entry.insert(0,00)\r\nsec_entry.insert(0,00)\r\n \r\n#Positioning the entry widgets.\r\n#place() takes an x(from the left) and y(from the top) coordinate\r\nhour_entry.place(x=80,y=40)\r\nmin_entry.place(x=130,y=40)\r\nsec_entry.place(x=180,y=40)\r\n \r\n#To link the defined placeholder removal functions on mouse click\r\nhour_entry.bind(\"&lt;1&gt;\", h_click)\r\nmin_entry.bind(\"&lt;1&gt;\", m_click)\r\nsec_entry.bind(\"&lt;1&gt;\", s_click)\r\n<\/pre>\n<p><strong>Code explanation:<\/strong><\/p>\n<ul>\n<li><strong>title_label:<\/strong> To display non-editable text in the countdown timer window, we use labels. Label() has 2 mandatory parameters: window and text to display. Position the label or any widget using pack().<\/li>\n<li><strong>IntVar():<\/strong> Declaring integer variables for hours, minutes and seconds. A prompt, in the try..except of the timer function, is raised if the user gives decimals or other characters.<\/li>\n<li><strong>Entry():<\/strong> To take user input, we use Entry widget. The parameters are window, width of the entry field, textvariable which denotes the integer variable declared previously. Font styling is optional.<\/li>\n<li><strong>hour_entry.insert():<\/strong> To insert a placeholder of 00 starting with the index 0. We extend the same for minutes and seconds entry widgets.<\/li>\n<li><strong>hour_entry.place():<\/strong> Similar to pack(), place() is another positioning function. This function takes 2 parameters which is the distances from the left margin and the top margin as coordinates (x,y)<\/li>\n<li><strong>hour_entry.bind():<\/strong> Removal of the placeholder when the mouse clicks on the entry fields. &lt;1&gt; indicates mouse button 1 which is the left click.<\/li>\n<\/ul>\n<h4>5. Addition of a button to activate the timer:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#button to activate the timer function\r\nbutton = Button(window,text='Activate Timer',bg='Red', command=timer).pack(pady=40)\r\n#Close the window and exit the app\r\nwindow.mainloop()\r\n<\/pre>\n<p><strong>Code explanation:<\/strong><br \/>\nThis snippet of code is optional<\/p>\n<ul>\n<li>Button(): When the user selects or clicks on a button, a function is called. Thus to call functions or a specific task based on user input (interaction), we make use of buttons.<\/li>\n<\/ul>\n<h3>Python Countdown Timer Output:<\/h3>\n<p>Enter the time for the countdown timer and view the notification:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-demo.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-97891\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-demo.gif\" alt=\"countdown timer demo\" width=\"556\" height=\"400\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-demo.gif 556w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-demo-520x374.gif 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-demo-320x230.gif 320w\" sizes=\"auto, (max-width: 556px) 100vw, 556px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-97890\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output.png\" alt=\"python countdown timer output\" width=\"1366\" height=\"726\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output.png 1366w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output-768x408.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output-720x383.png 720w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output-520x276.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/python-countdown-timer-output-320x170.png 320w\" sizes=\"auto, (max-width: 1366px) 100vw, 1366px\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>We have successfully created python countdown timer with plyer, tkinter and time modules. The project explores many features of Tkinter such as entry widgets, mouse clicks, buttons and placeholders. Using two ways, notifications were created and used.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A countdown timer is an ideal way to set targets to complete tasks eg keep a reminder for the oven etc. For large-scale applications such as industries, complex timers are used, which are custom-designed&#46;&#46;&#46;<\/p>\n","protected":false},"author":5,"featured_media":97893,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[46],"tags":[24695,24694,21082],"class_list":["post-97887","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-countdown-timer","tag-python-countdown-timer","tag-python-project"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Create a Countdown Timer in Python - DataFlair<\/title>\n<meta name=\"description\" content=\"Create countdown timer in python with plyer, tkinter and time modules. It displays a desktop notification on completion of timer\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Create a Countdown Timer in Python - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Create countdown timer in python with plyer, tkinter and time modules. It displays a desktop notification on completion of timer\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-03T03:30:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-01T07:15:09+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-in-python.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Create a Countdown Timer in Python - DataFlair","description":"Create countdown timer in python with plyer, tkinter and time modules. It displays a desktop notification on completion of timer","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/","og_locale":"en_US","og_type":"article","og_title":"How to Create a Countdown Timer in Python - DataFlair","og_description":"Create countdown timer in python with plyer, tkinter and time modules. It displays a desktop notification on completion of timer","og_url":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2021-07-03T03:30:05+00:00","article_modified_time":"2026-06-01T07:15:09+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-in-python.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823"},"headline":"How to Create a Countdown Timer in Python","datePublished":"2021-07-03T03:30:05+00:00","dateModified":"2026-06-01T07:15:09+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/"},"wordCount":1232,"commentCount":2,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-in-python.jpg","keywords":["countdown timer","python countdown timer","Python project"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/","url":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/","name":"How to Create a Countdown Timer in Python - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-in-python.jpg","datePublished":"2021-07-03T03:30:05+00:00","dateModified":"2026-06-01T07:15:09+00:00","description":"Create countdown timer in python with plyer, tkinter and time modules. It displays a desktop notification on completion of timer","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-in-python.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2021\/07\/countdown-timer-in-python.jpg","width":1200,"height":628,"caption":"countdown timer in python"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/create-countdown-timer-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Python Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/python\/"},{"@type":"ListItem","position":3,"name":"How to Create a Countdown Timer in Python"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/7f83c342f5d1632d6f7b4b0b0f447823","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/4cf3a74600d131330b8c481d519afd1574093ed89f6d3396a95393ad223eb7cd?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"DataFlair Team creates expert-level guides on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our goal is to empower learners with easy-to-understand content. Explore our resources for career growth and practical learning.","url":"https:\/\/data-flair.training\/blogs\/author\/dfteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/97887","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=97887"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/97887\/revisions"}],"predecessor-version":[{"id":148633,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/97887\/revisions\/148633"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/97893"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=97887"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=97887"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=97887"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}