I want to call an async function from a Tkinter button command, or rather want to let the function run asynchronously, so that the tkinter window is responsive.
I've tried command = open_async in the Button, where open_async was declared like so async def open_async():, but it gave me an error "RuntimeWarning: coroutine 'open_async' was never awaited
self.tk.mainloop(n)".
If I just used def async():, the code would still run synchronously, thus the UI will be unresponsive. (async() contains some other asynchronous operation inside too, using asyncio and stuff).
Anyone knows how to resolve this? I don't want to create threads too.
Thanks