会员
周边
众包
新闻
博问
闪存
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
二十二a
博客园
首页
新随笔
新文章
联系
管理
订阅
2018年8月4日
关于python生成器 yield第一次不能用send发送数据
摘要: 1 import time 2 def consumer (name): 3 print("%s要开始吃包子啦"%name) 4 while True: 5 baozi = yield 6 print("包子[%s]来了,被[%s]吃了!" % (baozi, name)) 7 8 # a = consumer("Alex") ...
阅读全文
posted @ 2018-08-04 19:34 二十二a
阅读(120)
评论(0)
推荐(0)
编辑
公告