-1
** 내 코드에 무슨 문제가 있습니까? 카운트 다운을하지만 백그라운드에서 실제로 사용자에게 표시되도록하여 얼마나 많은 시간이 남았는지 확인할 수 있습니다. **카운트 다운 작동하지 않음
#set up the screen
root = Tk()
root.minsize(width = 500, height=255)
frame = Frame(root)
frame.pack(fill=X)
frame.grid_columnconfigure(1, weight=100, minsize=50)
frame.grid_rowconfigure(1, weight=1)
separator = Frame(root, height = 5, bg="black")
separator.pack(fill=X, pady = 10)
clock= 10
timer = Label(frame, text=clock)
def countDown():
global clock, timer
while clock > 0:
time.sleep(1)
clock-=1
timer.configure(text = clock)
# Create items that will be on screen
button1 = ttk.Button(frame, text="GO!", command=countDown)
button2 = ttk.Button(frame, text="SAVE")`
canvas = Canvas(root, width=500, height=500)
# Place items on screen
button1.grid(column=0, row=1, sticky="W")
timer.grid(column=1, row=1)`
button2.grid(column=2, row=1, sticky="E")
canvas.pack()