Advertisement
Guest User

Untitled

a guest
Oct 20th, 2016
1,230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.30 KB | None | 0 0
  1. import asyncio
  2.  
  3. async def do_io():
  4.     print('io start')
  5.     await asyncio.sleep(5)
  6.     print('io end')
  7.  
  8. async def do_other_things():
  9.     print('doing other thigns')
  10.  
  11. loop = asyncio.get_event_loop()
  12.  
  13. loop.run_until_complete(do_io())
  14. loop.run_until_complete(do_other_things())
  15.  
  16. loop.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement