Display Calendar Using Python
Code
# importing tkinter
from tkinter import *
# importing calendar module
import calendar
# initializing tkinter
root = TK()
# setting title of our Gui
root.title( "My own Calendar" )
# year for which we want the calendar to be show on our Gui
year = 2020
# storing 2020 year calendar data inside myCal
myCal = calendar . calendar(year)
# showing calendar data using label widget
cal_year = Label(root, text=myCal , font="Consolas 10 bond")
# packing the Label widget
cal_year. pack()
# running the program in ready state
root.mainloop()
Output
Comments