0% found this document useful (0 votes)
10 views2 pages

111

Uploaded by

123go1324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views2 pages

111

Uploaded by

123go1324
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 2

from tkinter import *

import time
from tkinter import messagebox as mb

class Click:
def __init__(z):
z.labegsbsls()
z.buttons()
z.show()
z.count=0
z.timer()
def labels(z):

L1=Label(gui,text='CLICK !',width=24,bg='green',fg='white',font=('Gunplay',30,'bold
'))
L1.place(x=0,y=2)
def b1(z):
z.count+=1
a=z.count
Display=Label(gui,width=10,height=2,bg="black",fg="orange red",
font=("Terminal",30,"bold"),text=a)
Display.place(x=100,y=140)
def buttons(z):

B1=Button(gui,text='Click',command=z.b1,height=0,width=10,bg='red',fg='white',font=
('Impact',30))
B1.place(x=150,y=280)
def show(z):
Display=Label(gui,width=10,height=2,bg="black",fg="orange red",
font=("Terminal",30,"bold"),text='0')
Display.place(x=100,y=140)

def timer(z):
minute = StringVar()
second = StringVar()
minute.set("00")
second.set("00")
minuteEntry = Label(gui , width=2, bg="black", fg="red2",
font=("System", 18, "bold"), textvariable=minute)
minuteEntry.place(x=410, y=55)
secondEntry = Label(gui, width=2, bg="black", fg="red2",
font=("System", 18, "bold"), textvariable=second)
secondEntry.place(x=455, y=55)
try:
temp = 0 * 60 + 11
except:
print("Please input the right value")

while temp > -1:


mins, secs = divmod(temp, 60)
minute.set(r"{0:2d}".format(mins))
second.set(r"{0:2d}".format(secs))
gui.update()
time.sleep(1)
if temp == 0:
z.display_resultTimer()
gui.destroy()
temp -= 1
def display_resultTimer(lmaoz):
num = f"Your Clicks : {z.count}"
mb.showinfo("Time's up", f"{num}")

gui = Tk()
gui.geometry('500x400')
gui.title('Click !')
Click()
gui.mainloop()

You might also like