Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import time
- import asyncio
- loop = asyncio.get_event_loop()
- async def a_print(v):
- time.sleep(v)
- print(v)
- return v*2
- async def main():
- loop.create_task(a_print(2))
- print(1)
- if __name__ == '__main__':
- loop.run_until_complete(main())
- # 1
- # 2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement