การพิมพ์ครั้งที่ 1
การพิมพ์ครั้งที่ 2
การพิมพ์ครั้งที่ 3
def my_callback(dt): pass # call my_callback every 0.5 seconds event = Clock.schedule_interval(my_callback, 0.5) # call my_callback in 5 seconds event2 = Clock.schedule_once(my_callback, 5) event_trig = Clock.create_trigger(my_callback, 5) event_trig() # unschedule using cancel event.cancel() # unschedule using Clock.unschedule Clock.unschedule(event2) # unschedule using Clock.unschedule with the callback # NOT RECOMMENDED Clock.unschedule(my_callback)def my_callback(dt):
pass # call my_callback every 0.5 seconds event = Clock.schedule_interval(my_callback, 0.5) # call my_callback in 5 seconds event2 = Clock.schedule_once(my_callback, 5) event_trig = Clock.create_trigger(my_callback, 5) event_trig() # unschedule using cancel event.cancel() # unschedule using Clock.unschedule Clock.unschedule(event2) # unschedule using Clock.unschedule with the callback # NOT RECOMMENDED Clock.unschedule(my_callback)