如何延迟kivy中的事情

How to delay things in kivy

import kivy
from kivy.clock import Clock, mainthread
if int(value) > int(value2):
    self.ids.scoring.text = 'blue wins'
    Clock.schedule_once(2)
    self.ids.scoring.text = '0-0' 

我在 Pycharm 中 运行 此代码,但我收到此错误消息:

File "kivy_clock.pyx", line 498, in kivy._clock.CyClockBase.schedule_once ValueError: callback must be a callable, got 2

我该如何解决这个问题?

作为文档 https://kivy.org/doc/stable/api-kivy.clock.html

和错误消息 callback must be a callable

Clock.schedule_once() 正在等待 function,而不是 int

# dt means delta-time
def my_callback(dt):
    self.ids.scoring.text = 'blue wins'

# call my_callback in 5 seconds
Clock.schedule_once(my_callback, 2)
self.ids.scoring.text = '0-0'