I am trying to make a study reminder software but when the if the start value is as same as the hour variable it wont remind me

46 Views Asked by At
import time
import tkinter as tk
from tkinter import messagebox
from tkinter import ttk

studyTime = True

root = tk.Tk()

while studyTime:
    #Hour variable
    hour = time.strftime("%H")

    #Study Time1
    studyTime_start1 = "18:00"
    studyTime_end1 = "19:00"

    #Study Time2
    studyTime_start2 = "18:00"
    studyTime_end2 = "20:00"

    if hour < studyTime_end1 and hour > studyTime_start1:
        Msg = tk.messagebox.showinfo(title = "Study Time", message = "Study Time")
        HW_checkBtn = ttk.Button(root, text = "Study Time Started Click Here to Start")
        HW_checkBtn.pack()
        studyTime = False

    if hour < studyTime_end2 and hour > studyTime_start2:
        Msg1 = tk.messagebox.showinfo(title = "Study Time1", message = "Study Time1")
        HW_checkBtn1 = ttk.Button(root, text = "Study Time Started Click Here to Start")
        HW_checkBtn1.pack()
        studyTime = False

root.mainloop()
0

There are 0 best solutions below