编辑:当第二个计时器到达0并调用Note()函数时,我现在得到一个runtimeerror:'main thread is not in mainloop‘
from datetime import datetime
from threading import Timer
from tkinter import messagebox
import json
def Note():
z = messagebox.showinfo("Note", note)
class Timers:
def __init__(self,a,b,c,d,e):
self.a = month
self.b = day
self.c = hour
self.d = minute
self.e = note
x = datetime.today()
y = x.replace(month=month, day=day, hour=hour, minute=minute, second=0, microsecond=0)
delta_t = y - x
secs = delta_t.seconds
T = Timer(secs, Note)
T.start()
https://stackoverflow.com/questions/52522770
复制相似问题