灵魂跑者

关注

python create_future

灵魂跑者

关注

阅读 28

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

今天你读书了吗 49 0 0

GhostInMatrix

Python中create()

GhostInMatrix 63 0 0

诗与泡面

有关Python中的__future__模块

诗与泡面 99 0 0

捌柒陆壹

Python涨知识——__future__是什么?

捌柒陆壹 157 0 0

十里一走马

future相关

十里一走马 42 0 0

自由的美人鱼

python create_engine 释放

自由的美人鱼 38 0 0

小时候是个乖乖

Future详解

小时候是个乖乖 92 0 0

大明宫

2 Future

大明宫 37 0 0

秦瑟读书

Create & Access SQLite database using Python

秦瑟读书 28 0 0

陆佃

Create and activate python venv stable diffusion

陆佃 16 0 0

精彩评论(0)

0 0 举报