schedule, calendar, tinter and Threading

Viewed 37

I want to create a schedule that can update the calendar daily. I'm using the code below but it seems I'm using the Thread or the Schedule in the wrong way. If I use Calendar only, the date will never change.

from tkinter import *
import threading
import schedule
import calendar
from tkcalendar import *

root = Tk()

box = Frame(root, width=500, height=550,highlightbackground="red", highlightthickness=5)
box.grid(row=0, column=1)
root.geometry('1000x500')
crm = Calendar (root, firstweekday='sunday',selectmode='none',showweeknumbers=False,
               font=('Helvetica',15, 'bold'),
               fill='both',expand=True)

calendar.setfirstweekday(calendar.SUNDAY)
crm.grid(ipady=110,ipadx=250,row=0,column=0)


def job1():
    threading.Thread(target=job2).start()


def job2():
    print('its time')# HERE I WANT to the Schedule UPDATE the Calendar


schedule.every().day.at("00:00").do(job1)


schedule.run_all()
root.mainloop()
0 Answers
Related