#验证码程序
import random ran = "" for i in range(4): value = random.randint(0,4) if value == i : ran += str(random.randint(0,9)) else: ran += chr(random.randint(65,90)) print (ran)
import sys import time fileSize = 780 #print (type(fileSize)) tranSpeed = 36.2 tranTime = int(fileSize/tranSpeed) while tranTime >0: # print (tranTime) sys.stdout.write(">") sys.stdout.flush() #默认数据输出前先放在缓存中,通过flush实现不放入缓存 time.sleep(1) tranTime -=1