i have been trying to make a kind of reminder that pop your next task but i also wanted another indicator that tells the next task the issue is when the next task pop up is opened the other one cant open
import time
import tkinter as tk
from tkinter import messagebox
routine_schedule = [
(8, 0, "Wake up and hydrate"),
(8, 15, "Mindfulness or meditation"),
(8, 30, "Morning exercise"),
(9, 0, "Healthy breakfast"),
(9, 30, "Start coding session"),
(10, 55, "Pomodoro break - Stretch and hydrate"),
(11, 0, "Back to coding"),
(12, 30, "Lunch break"),
(13, 30, "Outdoor time"),
(14, 0, "Continue coding"),
(15, 25, "Pomodoro break - Creative activity"),
(15, 30, "Coding session"),
(17, 0, "Evening workout/activity"),
(18, 0, "Healthy dinner"),
(19, 0, "Relaxation time"),
(20, 0, "Digital detox"),
(21, 0, "Prepare for sleep"),
]
def notify_task(task):
root = tk.Tk()
root.withdraw()
messagebox.showinfo("Task Reminder", f"It's time to: {task}")
root.destroy()
def get_next_task():
current_time = time.localtime()
for schedule_hour, schedule_minute, schedule_task in routine_schedule:
if (current_time.tm_hour < schedule_hour) or (current_time.tm_hour == schedule_hour and current_time.tm_min < schedule_minute):
return schedule_hour, schedule_minute, schedule_task
return None
def display_next_task():
next_task = get_next_task()
if next_task:
next_hour, next_minute, next_task_description = next_task
next_task_text = f"Next task: {next_task_description}\nTime: {next_hour:02d}:{next_minute:02d}"
root1 = tk.Tk()
root1.withdraw()
messagebox.showinfo("Next Task", next_task_text)
root1.destroy()
# Main routine loop
while True:
current_time = time.localtime()
display_next_task()
for schedule_hour, schedule_minute, schedule_task in routine_schedule:
if current_time.tm_hour == schedule_hour and current_time.tm_min == schedule_minute:
notify_task(schedule_task)
time.sleep(0)
i tryied everything i think