Advertisement
paulogp

Asyncio 02

May 25th, 2017
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.20 KB | None | 0 0
  1. import asyncio
  2. loop = asyncio.get_event_loop()
  3.  
  4. async def hello():
  5.     print("Hello")
  6.     await asyncio.sleep(3)
  7.     print("World")
  8.  
  9. if __name__ == "__main__":
  10.     loop.run_until_complete(hello())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement