摘要: Python自动化开发(金角大王版) http://www.cnblogs.com/alex3714/articles/5885096.html http://www.cnblogs.com/alex3714/articles/5885096.html http://www.cnblogs.com/ 阅读全文
posted @ 2018-01-30 16:25 耐烦不急 阅读(548) 评论(0) 推荐(0) 编辑
摘要: import time def consumer(name): print("%s 准备吃包子啦!"%name) while True: baozi = yield print("包子[%s]来了,被[%s]吃了!"%(baozi,name)) def producer(name): c = consumer('A') c2 = c... 阅读全文
posted @ 2018-01-30 16:24 耐烦不急 阅读(138) 评论(0) 推荐(0) 编辑
摘要: import time def consumer(name): print('%s准备吃包子 '%name) while True: baozi=yield print('包子[%s]来了,被[%s]吃了'%(baozi,name)) c=consumer('猪小芳') c.__next__()#调用yield b1='韭菜馅' #以下两条语句,有... 阅读全文
posted @ 2018-01-30 16:23 耐烦不急 阅读(144) 评论(0) 推荐(0) 编辑
摘要: # map()函数 # map()是 Python 内置的高阶函数,它接收一个函数 f 和一个 list,并通过把函数 f 依次作用在 list 的每个元素上,得到一个新的 list 并返回。 # 例如,对于list [1, 2, 3, 4, 5, 6, 7, 8, 9] # 如果希望把list的每个元素都作平方,就可以用map()函数: # 因此,我们只需要传入函数f(x)=x*x,就可以利用... 阅读全文
posted @ 2018-01-30 16:22 耐烦不急 阅读(350) 评论(0) 推荐(0) 编辑
摘要: # home密码认证是本地文件认证,bbs密码认证是远程ldat认证 import time user, passwd = 'qi', '123' def auth(auth_type): print('auth func:', auth_type) def outwrapper(func): def wrappper(*args, **kwargs): ... 阅读全文
posted @ 2018-01-30 00:11 耐烦不急 阅读(169) 评论(0) 推荐(0) 编辑