[issue27579] Add a tutorial for AsyncIO in the documentation

Terry J. Reedy report at bugs.python.org
Sat Jul 23 22:09:19 EDT 2016


Terry J. Reedy added the comment:

I would like the tutorial to include something like the following.

Adding Tkinter GUI to Asyncio Program
-------------------------------------

Assuming that the tkinter Tk instance is called 'root' and the asyncio loop is called 'loop', add the following callback loop.

def tk_update():
    root.update()
    loop.call_soon(tk_update)

Before each loop.run_forever() or loop.run_until_complete(...) call, add

tk_update()

Do not call root.mainloop() or root.quit().  Loop.stop() or completion of run_until_complete will stop the tk_update loop.
---

This is the result of my experiments in #27546.  One of my tests was running IDLE with an asyncio loop augmented with the above replacing root.mainloop.  I don't yet know how to work with git and github.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue27579>
_______________________________________


More information about the Python-bugs-list mailing list