forked from avinashkranjan/Amazing-Python-Scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalendar_gui.py
62 lines (34 loc) · 1.28 KB
/
Calendar_gui.py
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
# -*- coding: utf-8 -*-
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()