摘要: import os, sys, time, datetime, shutil import paramiko,hashlib,threading class Update(object): def __init__(self): self.Twip = [] self.Twtp = [] self.menu = { ... 阅读全文
posted @ 2017-10-27 14:51 bruce61 阅读(134) 评论(0) 推荐(0)
摘要: #随机验证码生成 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... 阅读全文
posted @ 2017-09-23 09:20 bruce61 阅读(92) 评论(0) 推荐(0)
摘要: import time,datetime x=time.localtime() print(time.strftime('%Y-%m-%d %H:%M',x)) print(datetime.datetime.now()+datetime.timedelta(days=-3)) 阅读全文
posted @ 2017-09-23 09:19 bruce61 阅读(112) 评论(0) 推荐(0)
摘要: import time def consumer(name): print("%s 准备吃包子啦!" %name) while True: baozi = yield print("包子[%s]来了,被[%s]吃了!" %(baozi,name)) def producer(name,name1): c = consumer(name) ... 阅读全文
posted @ 2017-09-21 17:39 bruce61 阅读(102) 评论(0) 推荐(0)
摘要: #无传参版 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... 阅读全文
posted @ 2017-09-21 10:24 bruce61 阅读(137) 评论(0) 推荐(0)
摘要: 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: ... 阅读全文
posted @ 2017-09-18 17:45 bruce61 阅读(129) 评论(0) 推荐(0)