wickyo's recent timeline updates
wickyo

wickyo

V2EX member #518459, joined on 2020-11-20 14:57:01 +08:00
wickyo's recent replies
Jan 4, 2021
Replied to a topic by rqxiao Python Python 中 asyncio.get_event_loop()的提问
get_event_loop 是一个线程中的 event_loop,run_until_complete 会等给定的协程对象完成后再结束,你这样是会有多个协程,但是都是同步的,如果是要协程并发可以用 gather

import asyncio

async def do_some_work(x):

print(x)
await asyncio.sleep(0.1)
print('end')




async def main():
coroutine1 = do_some_work(1)
coroutine2 = do_some_work(2)
await asyncio.gather(
coroutine1,
coroutine2
)

loop = asyncio.get_event_loop()

loop.run_until_complete(main())
Nov 23, 2020
Replied to a topic by revival83 问与答 纠结是一加 8T 还是 iPhone11 求建议
用的一加 6,已经两年了,还可以再战两年觉得,系统的话,仁者见仁,智者见智,我是觉得很喜欢氢 os 系统,很简洁,没有那么多乱七八糟的东西,
About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   3054 Online   Highest 6679   ·     Select Language
创意工作者们的社区
World is powered by solitude
VERSION: 3.9.8.5 · 15ms · UTC 14:51 · PVG 22:51 · LAX 07:51 · JFK 10:51
♥ Do have faith in what you're doing.