Async Python code from sync code
About async Python and why do you need it you can find from article Non-sequential Python.
Sometimes you want to call async code from sync evironment like REPL.
Before Python 3.7 it was not easy
In Python 3.7 we have function asyncio.run
And in Python 3.8 we even can run REPL in async mode (
python -m asyncio).
Suppose the code above is in file sync_async.py: