Skip to content

Instantly share code, notes, and snippets.

View lkfo415579's full-sized avatar
💭
0.0

Revo lkfo415579

💭
0.0
  • Tencent AI Lab
  • Macau
View GitHub Profile
@lkfo415579
lkfo415579 / async-python.py
Created August 1, 2017 03:29 — forked from pkazmierczak/async-python.py
asyncio example (python3 & python2)
import asyncio
@asyncio.coroutine
def factorial(name, number):
f = 1
for i in range(2, number + 1):
print("Task %s: Compute factorial(%d)..." % (name, i))
yield from asyncio.sleep(1)
f *= i