@@ -0,0 +1,1509 @@
+import asyncio%0Aimport aiotkinter%0Aimport tkinter%0Aimport tkinter.messagebox%0A%0A%0Aasync def async_loop():%0A    print(%22Thanks for calling%22)%0A    while True:%0A        await asyncio.sleep(1)%0A        print(%22Ping!%22)%0A%0A%0Adef async_cb(coro_fn, loop):%0A    def cb():%0A        asyncio.ensure_future(coro_fn(), loop=loop)%0A%0A    return cb%0A%0A%0Adef main():%0A    asyncio.set_event_loop_policy(aiotkinter.TkinterEventLoopPolicy())%0A    loop = asyncio.get_event_loop()  # type: asyncio.BaseEventLoop%0A    quitted = asyncio.Event(loop=loop)%0A%0A    root = tkinter.Tk()%0A    text = %22This is Tcl/Tk version %25s%22 %25 tkinter.TclVersion%0A    text += %22%5CnThis should be a %C3%98%22%0A    label = tkinter.Label(root, text=text)%0A    label.pack()%0A    test = tkinter.Button(root, text=%22Click me!%22,%0A              command=lambda: root.test.configure(%0A                  text=%22%5B%25s%5D%22 %25 root.test%5B'text'%5D))%0A    test.pack()%0A    root.test = test%0A%0A    async def quit_action():%0A        if tkinter.messagebox.askyesno('Quit?', 'Really quit?'):%0A            root.destroy()%0A            quitted.set()%0A%0A    root.protocol(%22WM_DELETE_WINDOW%22, quit_action)%0A    quit = tkinter.Button(root, text=%22QUIT%22,%0A                          command=async_cb(quit_action, loop))%0A    quit.pack()%0A    # The following three commands are needed so the window pops%0A    # up on top on Windows...%0A    root.iconify()%0A    root.update()%0A    root.deiconify()%0A    # root.mainloop()%0A    asyncio.ensure_future(async_loop(), loop=loop)%0A    loop.run_until_complete(quitted.wait())%0A%0A%0Aif __name__ == '__main__':%0A    main()%0A

Add test.py