@@ -0,0 +1,1076 @@
+import sys%0Asys.path.insert(0, %22..%22)%0Afrom kivy.app import App%0Afrom kivy.uix.button import Button%0Afrom kivy.uix.label import Label%0Afrom kivy.uix.gridlayout import GridLayout%0Aimport time%0A%0Afrom async_gui.engine import Task, MultiProcessTask%0Afrom async_gui.toolkits.kivy import KivyEngine%0A%0Afrom cpu_work import is_prime, PRIMES%0A%0A%0Aengine = KivyEngine()%0A%0Aclass MyApp(App):%0A    def build(self):%0A        grid = GridLayout(cols=4)%0A%0A        grid.add_widget(Button(text='Check Primes',%0A                               on_press=self.cpu_bound))%0A        self.status = Label(text='Status')%0A        grid.add_widget(self.status)%0A        return grid%0A%0A    @engine.async%0A    def cpu_bound(self, *_):%0A        t = time.time()%0A        self.status.text = %22calculating...%22%0A        prime_flags = yield MultiProcessTask(%0A            %5BTask(is_prime, n) for n in PRIMES%5D%0A        )%0A        print(time.time() - t)%0A        text = '%5Cn'.join(%22%25s: %25s%22 %25 (n, prime)%0A                         for n, prime in zip(PRIMES, prime_flags))%0A        self.status.text = text%0A%0A%0Aif __name__ == '__main__':%0A    MyApp().run()%0A%0A

add kivy example