Skip to content

Instantly share code, notes, and snippets.

@wwj718
Created January 26, 2018 07:50
Show Gist options
  • Save wwj718/7821f69a84ae16ab1e8fc75d2fb1c44b to your computer and use it in GitHub Desktop.
Save wwj718/7821f69a84ae16ab1e8fc75d2fb1c44b to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import uasyncio
async def hello():
print('Hello world! ' )
await uasyncio.sleep(1)
print('Hello again! ' )
loop = uasyncio.get_event_loop()
tasks = [hello(), hello()]
# loop.run_until_complete(uasyncio.wait(tasks))
loop.create_task(hello())
loop.create_task(hello())
loop.run_forever()
#loop.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment