Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import asyncio
- async def foo():
- print('foo start')
- await asyncio.sleep(1)
- print('foo end')
- async def main():
- print('main start')
- asyncio.ensure_future(foo())
- await asyncio.sleep(2)
- print('main end')
- asyncio.run(main())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement