Repository navigation
Expand file tree
/
Copy pathchart.py
More file actions
111 lines (94 loc) · 1.95 KB
/
Copy pathchart.py
File metadata and controls
111 lines (94 loc) · 1.95 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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
from tkinter import *
from tkcalendar import *
ws = Tk()
ws.title("Python Guides")
ws.geometry("500x400")
ws.config(bg="#cd950c")
hour_string = StringVar()
min_string = StringVar()
last_value_sec = ""
last_value = ""
f = ('Times', 20)
def display_msg():
date = cal.get_date()
m = min_sb.get()
h = sec_hour.get()
s = sec.get()
t = f"Your appointment is booked for {date} at {m}:{h}:{s}."
msg_display.config(text=t)
if last_value == "59" and min_string.get() == "0":
hour_string.set(int(hour_string.get()) + 1 if hour_string.get() != "23" else 0)
last_value = min_string.get()
if last_value_sec == "59" and sec_hour.get() == "0":
min_string.set(int(min_string.get()) + 1 if min_string.get() != "59" else 0)
if last_value == "59":
hour_string.set(int(hour_string.get()) + 1 if hour_string.get() != "23" else 0)
last_value_sec = sec_hour.get()
fone = Frame(ws)
ftwo = Frame(ws)
fone.pack(pady=10)
ftwo.pack(pady=10)
cal = Calendar(
fone,
selectmode="day",
year=2021,
month=2,
day=3
)
cal.pack()
min_sb = Spinbox(
ftwo,
from_=0,
to=23,
wrap=True,
textvariable=hour_string,
width=2,
state="readonly",
font=f,
justify=CENTER
)
sec_hour = Spinbox(
ftwo,
from_=0,
to=59,
wrap=True,
textvariable=min_string,
font=f,
width=2,
justify=CENTER
)
sec = Spinbox(
ftwo,
from_=0,
to=59,
wrap=True,
textvariable=sec_hour,
width=2,
font=f,
justify=CENTER
)
min_sb.pack(side=LEFT, fill=X, expand=True)
sec_hour.pack(side=LEFT, fill=X, expand=True)
sec.pack(side=LEFT, fill=X, expand=True)
msg = Label(
ws,
text="Hour Minute Seconds",
font=("Times", 12),
bg="#cd950c"
)
msg.pack(side=TOP)
actionBtn = Button(
ws,
text="Book Appointment",
padx=10,
pady=10,
command=display_msg
)
actionBtn.pack(pady=10)
msg_display = Label(
ws,
text="",
bg="#cd950c"
)
msg_display.pack(pady=10)
ws.mainloop()