2
有沒有什麼辦法可以在Kivy中取消UrlRequest?有什麼辦法可以在Kivy中取消UrlRequest?
def got_url(req, result):
print(result)
req = UrlRequest('http://httpbin.org/delay/2', got_url) # Request lasts 2 seconds
def my_callback(dt):
print('Request cancelled.')
# sort of req.cancel()
Clock.schedule_once(my_callback, 1) # But some event happens after 1 sec. and I want to cancel request
這只是一個例子:我知道超時,我想取消某些任意事件的請求。