Hi List,

for everyone who wants to test their asyncio code on a 
live system, I have written an extension to IPython
(here: https://github.com/tecki/ipython-yf )
which allows for the use of yield from on the command
line, while your event loop is running.

To give an example:

>>> %load_ext yf
>>> from asyncio import sleep, async
>>> def f():
...        yield from sleep(3)
...        print("done")
>>> yield from f()
[wait three seconds]
done
>>> async(f())
>>> [wait three seconds, or type other commands] done

So, as you see, the event loop is running while you are
typing commands, and while they are running. This is
especially interesting once you use a GUI at the same
time, like Qt, as it stays responsive while you're doing
stuff.

Greetings

Martin

Reply via email to