标签:producing sum ... rod turn cin nbsp min none
def consumer(): r = ‘‘ while True: n = yield r if not n: return print(‘[CONSUMER] Consuming %s...‘ % n) r = ‘200 OK‘ def produce(c): c.send(None) n = 0 while n < 5: n = n + 1 print(‘[PRODUCER] Producing %s...‘ % n) r = c.send(n) print(‘[PRODUCER] Consumer return: %s‘ % r) c.close() c = consumer() produce(c)
标签:producing sum ... rod turn cin nbsp min none
原文地址:https://www.cnblogs.com/saolv/p/9295685.html