I want to change the background for a particular cell in this calendar
cal = Calendar(root,selectmode="day",year=2020,month=7,day=10)
in Tkinter. but I do not know how to do that please help me.
You can attach a tag to the particular day using calevent_create()
and then use tag_config()
to change the background color using the tag:
Below is an example:
import datetime
...
day = datetime.date(2020, 7, 20)
cal.calevent_create(day, "", tags="hi")
cal.tag_config("hi", background="red")