This module allows you to run code on the main thread easely. This can be used for modifiying the UI.
import mainthread
def sayHello() -> None:
print("Hello World!")
mainthread.run_sync(sayHello)
run_async(code)
Runs the given code asynchronously on the main thread.
run_sync(code)
Runs the given code synchronously on the main thread.