add concurrence examples

This commit is contained in:
Mia von Steinkirch 2020-03-21 14:24:55 -07:00
parent 614452d462
commit 516c922e02
15 changed files with 64 additions and 248 deletions
Concurrence_examples

View file

@ -2,14 +2,13 @@
import asyncio
async def delayed_hello():
print("Hello ")
print('Hello ')
await asyncio.sleep(1)
print("World!")
print('World!')
if __name__ == "__main__":
loop = asyncio.get_event_loop()
loop.run_until_complete(delayed_hello())
loop.close()
loop = asyncio.get_event_loop()
loop.run_until_complete(delayed_hello())
loop.close()