灵魂跑者

关注

python create_future

灵魂跑者

关注

阅读 27

2023-11-22

 

 

import asyncio

async def main():
    loop = asyncio.get_running_loop()
    future = loop.create_future()
    print("Future created:", future)
    await asyncio.sleep(1)
    future.set_result("Hello, World!")
    print("Result:", await future)

asyncio.run(main())

 



相关推荐

今天你读书了吗

python create

今天你读书了吗 46 0 0

GhostInMatrix

Python中create()

GhostInMatrix 57 0 0

十里一走马

future相关

十里一走马 42 0 0

诗与泡面

有关Python中的__future__模块

诗与泡面 98 0 0

捌柒陆壹

Python涨知识——__future__是什么?

捌柒陆壹 157 0 0

自由的美人鱼

python create_engine 释放

自由的美人鱼 38 0 0

大明宫

2 Future

大明宫 30 0 0

小时候是个乖乖

Future详解

小时候是个乖乖 90 0 0

星巢文化

Future和Callable

星巢文化 24 0 0

秦瑟读书

Create & Access SQLite database using Python

秦瑟读书 27 0 0

精彩评论(0)

0 0 举报