from
kivy.app import App
from kivy.uix.label import Label
import asyncio
import time
class ExampleApp(App):
def build(self):
return Label(text = 'Greetings Earthlings')
def on_start(self):
print("Kivy app started")
asyncio.create_task(self.my_async_function())
async def my_async_function(self):
print("woohooo running async function on kivy app")
result = await self.another_async_function()
print(result)
async def another_async_function(self):
## long task to get some data from cloud
a=[]
for i in range(100000000):
a.append(i)
print("another async function")
return a
# Start kivy app as an asynchronous task
asyncio.run(ExampleApp().async_run('asyncio'))