import time
def consumer(name):
print("%s 准备吃包子啦!" %name)
while True:
baozi = yield # yield可以接收到外部send传过来的数据并赋值给baozi
print("包子[%s]来了,被[%s]吃了!" %
了解 yield ,send,__next__之间的关系
最新推荐文章于 2022-04-03 13:48:44 发布
import time
def consumer(name):
print("%s 准备吃包子啦!" %name)
while True:
baozi = yield # yield可以接收到外部send传过来的数据并赋值给baozi
print("包子[%s]来了,被[%s]吃了!" %