I just started my first project with Python, not only Python but also inside the world of coding. My project is to help my productivity to improve during this quaratine using POMODORO technique. My problem is to display the count down clock in the tk AND also making the count to be att and displayed.
def task():
minutes = 2
min = 5
seconds = 0
sec = 0
while True:
timer = str(minutes) + str(min) + ':' + str(seconds) + str(sec)
label = tk.Label(frame, text=timer, bg="green")
label.pack()
if seconds == 0 and sec == 0 and min == 0:
seconds = 5
sec = 9
min = 10
minutes = minutes - 1
if seconds == 0 and sec == 0:
seconds = 5
sec = 10
min = min - 1
if sec == 0:
sec = 10
seconds = seconds - 1
sec = sec - 1
time.sleep(1)
if minutes == 0 and seconds == 0 and sec == 0 and min == 0:
print('ご苦労様でした ! ! !')
break
root = tk.Tk()
root.title('POMODORO')
canvas = tk.Canvas(root, height=700, width=700, bg="green")
canvas.pack()
frame = tk.Frame(root, bg="white")
frame.place(relwidth = 0.8, relheight = 0.8, relx=0.1, rely=0.1)
task_button = tk.Button(frame,text="Start Task",padx = 10, pady=5, fg ="black", bg="green", command=task)
task_button.pack()
root.mainloop()
I found it difficult for my current level but every step done make me happier :)
Thanks for all your support already!