Skip to content

Commit 2ba8c3b

Browse files
committed
GUI Count Down Timer
1 parent d356955 commit 2ba8c3b

File tree

2 files changed

+62
-0
lines changed

2 files changed

+62
-0
lines changed
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
from tkinter import *
2+
3+
t = 0
4+
5+
6+
def set():
7+
global t
8+
t = t + int(entry.get())
9+
return t
10+
11+
12+
def start():
13+
global t
14+
if t > 0:
15+
lbl.config(text=t)
16+
t = t - 1
17+
lbl.after(1000,start)
18+
return t
19+
elif t == 0:
20+
lbl.config(text="go")
21+
22+
23+
root = Tk()
24+
25+
root.geometry("380x350")
26+
root.config(bg="black")
27+
28+
Label(root, text="Count Down Timer", font=("bell mt", 30),bg="black",fg="#00ff00").grid(row=0, column=0, padx=20)
29+
30+
Label(root,text="Select the seconds",font=("bell mt",20),bg="black",fg="#00ff00").grid(row=1,column=0,padx=20)
31+
32+
entry = Entry(root, font=("castellar", 15),fg="black")
33+
entry.grid(row=2, column=0, padx=20,pady=15)
34+
35+
b1 = Button(root, text='Set Timer', font=("bell mt", 20),bg="black",fg="#00ff00",width=10,height=1, command=set)
36+
b1.grid(row=3, column=0, padx=20,pady=10)
37+
38+
b2 = Button(root, text='Start Timer', font=("bell mt", 20),bg="black",fg="#00ff00",width=10,height=1, command=start)
39+
b2.grid(row=4, column=0, padx=20,pady=10)
40+
41+
lbl = Label(root, text="", font=("algerian", 30),fg="#00ff00",bg="black")
42+
lbl.grid(row=5, column=0, padx=20)
43+
44+
root.mainloop()

GUI Count Down Timer/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<h1 align="center">Count Down Timer</h1>
2+
3+
<h3>Imports</h3>
4+
<ul><li>from tkinter import *</li></ul>
5+
<br>
6+
7+
<ol>
8+
<li>Enter the seconds for the countdown</li>
9+
<li>Click on set time for setting the timer</li>
10+
<li>Then click start</li>
11+
<ol>
12+
<br><br>
13+
14+
![image](https://user-images.githubusercontent.com/70272542/143604324-b1a3d224-db09-498f-aa50-1154c05d849e.png)
15+
16+
17+
![image](https://user-images.githubusercontent.com/70272542/143605022-c3468f86-9548-4780-bff0-18478817ddc9.png)
18+

0 commit comments

Comments
 (0)