1+ from tkinter import *
2+ import tkinter as tk
3+ from PIL import ImageTk , Image
4+ import calendar
5+ root = tk .Tk ()
6+ root .geometry ('400x300' )
7+ root .title ('Calender-Techarge' )
8+ root .iconbitmap ("calender-ico.ico" )
9+
10+
11+ def show ():
12+
13+ m = int (month .get ())
14+ y = int (year .get ())
15+ output = calendar .month (y ,m )
16+
17+ cal .insert ('end' ,output )
18+
19+ def clear ():
20+ cal .delete (1.0 ,'end' )
21+
22+ def exit ():
23+ root .destroy ()
24+
25+
26+ img = ImageTk .PhotoImage (Image .open ('calendar.png' ))
27+ label = Label (image = img )
28+ label .place (x = 170 ,y = 3 )
29+
30+
31+
32+ m_label = Label (root ,text = "Month" ,font = ('verdana' ,'10' ,'bold' ))
33+ m_label .place (x = 70 ,y = 80 )
34+
35+ month = Spinbox (root , from_ = 1 , to = 12 ,width = "5" )
36+ month .place (x = 140 ,y = 80 )
37+
38+ y_label = Label (root ,text = "Year" ,font = ('verdana' ,'10' ,'bold' ))
39+ y_label .place (x = 210 ,y = 80 )
40+
41+ year = Spinbox (root , from_ = 2020 , to = 3000 ,width = "8" )
42+ year .place (x = 260 ,y = 80 )
43+
44+
45+ cal = Text (root ,width = 33 ,height = 8 ,relief = RIDGE ,borderwidth = 2 )
46+ cal .place (x = 70 ,y = 110 )
47+
48+ show = Button (root ,text = "Show" ,font = ('verdana' ,10 ,'bold' ),relief = RIDGE ,borderwidth = 2 ,command = show )
49+ show .place (x = 140 ,y = 250 )
50+
51+ clear = Button (root ,text = "Clear" ,font = ('verdana' ,10 ,'bold' ),relief = RIDGE ,borderwidth = 2 ,command = clear )
52+ clear .place (x = 200 ,y = 250 )
53+
54+ exit = Button (root ,text = "Exit" ,font = ('verdana' ,10 ,'bold' ),relief = RIDGE ,borderwidth = 2 ,command = exit )
55+ exit .place (x = 260 ,y = 250 )
56+ root .mainloop ()
0 commit comments