-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgui2.py
More file actions
27 lines (27 loc) · 1.23 KB
/
Copy pathgui2.py
File metadata and controls
27 lines (27 loc) · 1.23 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import tkinter as tk
from tkinter import *
root=tk.Tk()
root.title('Календарь')
root.geometry('1000x900+100+100')
root.configure(background='black')
Lab = Label(width=30,height=4,font=('Cascadia code','30','underline'),bg='black',fg='yellow',text='Мои текущие задачи')
Lab.pack(side=TOP)
tasks_frame = tk.Frame(root, bg='black')
tasks_frame.pack()
def load_tasks():
filename = "tasks.txt"
with open(filename, "r", encoding="utf-8") as file:
lines = file.readlines()
for line in lines:
line = line.strip()
if line.lower().startswith(("прошло","прошел")):
lbl = Label(tasks_frame,text=line,font=("Cascadia code", 20),bg="black",fg="red")
lbl.pack(pady=5)
elif line.lower().startswith(("прямо","прям","сейчас","щас")):
lbl = Label(tasks_frame,text=line,font=("Cascadia code", 20),bg="black",fg="yellow")
lbl.pack(pady=5)
elif line.lower().startswith(("осталось","остался")):
lbl = Label(tasks_frame,text=line,font=("Cascadia code", 20),bg="black",fg="gray")
lbl.pack(pady=5)
load_tasks()
root.mainloop()