Skip to content

GUI Count Down Timer #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 30, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions GUI Count Down Timer/Count Down Timer GUI.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
from tkinter import *

t = 0


def set():
global t
t = t + int(entry.get())
return t


def start():
global t
if t > 0:
lbl.config(text=t)
t = t - 1
lbl.after(1000,start)
return t
elif t == 0:
lbl.config(text="go")


root = Tk()

root.geometry("380x350")
root.config(bg="black")

Label(root, text="Count Down Timer", font=("bell mt", 30),bg="black",fg="#00ff00").grid(row=0, column=0, padx=20)

Label(root,text="Select the seconds",font=("bell mt",20),bg="black",fg="#00ff00").grid(row=1,column=0,padx=20)

entry = Entry(root, font=("castellar", 15),fg="black")
entry.grid(row=2, column=0, padx=20,pady=15)

b1 = Button(root, text='Set Timer', font=("bell mt", 20),bg="black",fg="#00ff00",width=10,height=1, command=set)
b1.grid(row=3, column=0, padx=20,pady=10)

b2 = Button(root, text='Start Timer', font=("bell mt", 20),bg="black",fg="#00ff00",width=10,height=1, command=start)
b2.grid(row=4, column=0, padx=20,pady=10)

lbl = Label(root, text="", font=("algerian", 30),fg="#00ff00",bg="black")
lbl.grid(row=5, column=0, padx=20)

root.mainloop()
18 changes: 18 additions & 0 deletions GUI Count Down Timer/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<h1 align="center">Count Down Timer</h1>

<h3>Imports</h3>
<ul><li>from tkinter import *</li></ul>
<br>

<ol>
<li>Enter the seconds for the countdown</li>
<li>Click on set time for setting the timer</li>
<li>Then click start</li>
<ol>
<br><br>

![image](https://user-images.githubusercontent.com/70272542/143604324-b1a3d224-db09-498f-aa50-1154c05d849e.png)


![image](https://user-images.githubusercontent.com/70272542/143605022-c3468f86-9548-4780-bff0-18478817ddc9.png)