摘要:
一、协程函数 1 协程函数的定义 协程函数就是使用了yield表达式形成的生成器 实例: def eater(name): print('%s eat food' %name) while True: food = yield print('done') g = eater('Yim') print 阅读全文
摘要:
一、协程函数 1 协程函数的定义 协程函数就是使用了yield表达式形成的生成器 实例: def eater(name): print('%s eat food' %name) while True: food = yield print('done') g = eater('Yim') print 阅读全文
|