mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-01-08 15:09:39 +07:00
(cherry picked from commit b66707327989822f23c57aa19fa81dd38a02ed67) GitOrigin-RevId: e85b75676c138cf9ce2de0ac07a88f19a730f5c0
19 lines
358 B
Python
19 lines
358 B
Python
import asyncio
|
|
|
|
|
|
async def compute(x, y):
|
|
print("Compute %s + %s ..." % (x, y))
|
|
await asyncio.sleep(1.0)
|
|
return x + y
|
|
|
|
|
|
async def print_sum(x, y):
|
|
result = await compute(x, y) # breakpoint and Step Over
|
|
print("%s + %s = %s" % (x, y, result))
|
|
|
|
|
|
z = 42
|
|
loop = asyncio.get_event_loop()
|
|
loop.run_until_complete(print_sum(1, 2))
|
|
loop.close()
|