MCPcopy Create free account
hub / github.com/ZiniuLu/Python-100-Days / create_package_center

Function create_package_center

Day66-75/code/coroutine02.py:24–32  ·  view source on GitHub ↗
(consumer, max_packages)

Source from the content-addressed store, hash-verified

22
23
24def create_package_center(consumer, max_packages):
25 num = 0
26 while num <= max_packages:
27 print('快递中心准备派送%d号包裹' % num)
28 consumer.send('包裹-%d' % num)
29 num += 1
30 if num % 10 == 0:
31 sleep(5)
32 consumer.send(None)
33
34
35def main():

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected