import time def run(coroutine): try: print("11") coroutine.send(None) except StopIteration as e: e.value,e.value) return e.value async async_function(): time.sleep(2) 等待两秒return 1 async await_coroutine(): await async_function() 等待执行完成,再执行我) run(await_coroutine())
# 输出结果
11
等待两秒
等待执行完成,再执行我
e.value None