09 2017 档案
摘要:#随机验证码生成 import random checkcode='' for i in range(4): conut = random.randrange(0,4) if conut == i: tmp = chr(random.randint(65,90)) else: tmp = random.randint(0,9) c...
阅读全文
摘要:import time,datetime x=time.localtime() print(time.strftime('%Y-%m-%d %H:%M',x)) print(datetime.datetime.now()+datetime.timedelta(days=-3))
阅读全文
摘要: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号