随笔分类 - python基础
摘要:import time def consumer(name): print("%s 准备吃包子啦!" %name) while True: baozi = yield print("包子[%s]来了,被[%s]吃了!" %(baozi,name)) def producer(name,name1): c = consumer(name) ...
阅读全文
摘要:#无传参版 import time def timer(func):# 函数test当做了一个变量传给了func def conut(): start_time=time.time() func() stop_time=time.time() print('the func run time is %s'%(stop_tim...
阅读全文
摘要:while True: username = input('name:').strip() password = input('passwd:').strip() if len(username) != 0 and len(password) != 0: with open('user_file','r',encoding='utf8') as f: ...
阅读全文

浙公网安备 33010602011771号