-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCalendar_GUI.py
More file actions
33 lines (30 loc) · 1.15 KB
/
Copy pathCalendar_GUI.py
File metadata and controls
33 lines (30 loc) · 1.15 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
from tkinter import *
import calendar
def showCal():
box = Tk()
box.title("Calendar For The Year")
box.geometry("550x600")
find_year = int(year_field.get())
first_label = Label(box,text='CALENdAR', bg='dark grey', font=("times",28,'bold'))
first_label.grid(row=1,column=1)
box.config(background="white")
cal_data = calendar.calendar(find_year)
cal_year = Label(box,text=cal_data,font="consolas 10 bold",justify=LEFT)
cal_year.grid(row=2,column=1,padx=20)
box.mainloop()
if __name__ == "__main__":
gui = Tk()
gui.config(background="misty rose")
gui.title("CALENDAR")
gui.geometry("250x250")
cal = Label(gui,text="CALENDAR",bg="lavender",font=("Helvetica",28,'bold','underline'))
year = Label(gui,text="Enter Year",bg="peach puff",padx=10,pady=10)
year_field = Entry(gui)
show = Button(gui,text="Show Calendar",fg="Black",bg="lavender",command=showCal)
Exit = Button(gui,text="CLOSE",bg="peach puff",command=exit)
cal.grid(row=1,column=1)
year.grid(row=3,column=1)
year_field.grid(row=4,column=1)
show.grid(row=5,column=1)
Exit.grid(row=7,column=1)
gui.mainloop()