Advertisement
paulogp

Asyncio 01

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