How to use async/await in Python 3.5?

Question or problem about Python programming: #!/usr/bin/env python3 # -*- coding: utf-8 -*- import time async def foo(): await time.sleep(1) foo() I couldn’t make this dead simple example to run: RuntimeWarning: coroutine ‘foo’ was never awaited foo() How to solve the problem: Solution 1: Running coroutines requires an event loop. Use the asyncio() library to […]

Continue Reading