diff --git a/bonusova_uloha.py b/bonusova_uloha.py deleted file mode 100644 index ae3cb05..0000000 --- a/bonusova_uloha.py +++ /dev/null @@ -1,46 +0,0 @@ -import tkinter as tk -import time -c = tk.Canvas(bg="grey", width=600, height=400) -c.pack() - -file = open("spokojnost.txt", "w").close() - - -def draw(rect_color0="yellow", rect_color1="yellow"): - c.create_text(250, 150, text="Boli ste spokojny \ns nasimi sluzbami?", font="arial 30", fill="white") - - c.create_rectangle(50, 280, 150, 320, fill=rect_color0) - c.create_text(100, 300, text="ano:)", font="arial 20") - - c.create_rectangle(350, 280, 450, 320, fill=rect_color1) - c.create_text(400, 300, text="nie:(", font="arial 15") - c.update() - - -def click(pos): - file_ = open("spokojnost.txt", "a") - - if 280 <= pos.y <= 320: - if 50 <= pos.x <= 150: - file_.write("ano\n") - draw("orange") - - time.sleep(0.1) - - draw() - - elif 350 <= pos.x <= 450: - file_.write("nie\n") - draw("yellow", "orange") - - time.sleep(0.1) - - draw() - - file_.close() - - -c.bind_all("", click) - -draw() -c.mainloop()