随机数应用,,from random
文章由Byrx.net分享于2019-03-23 07:03:14
随机数应用,,from random
from random import randint, choicefrom string import lowercasefrom sys import maxintfrom time import ctimedoms = ('com', 'edu', 'net', 'org', 'gov')for i in range(randint(5,10)): dtint = randint(0, maxint-1) dtstr = ctime(dtint) # date string shorter = randint(4,7) em = '' for j in range(shorter): em +=choice(lowercase) longer = randint(shorter,12) #domain dn = '' for j in range(longer): dn += choice(lowercase) print '%s::%s@%s.%s::%d-%d-%d' % (dtstr, em, dn, choice(doms), dtint, shorter, longer#该片段来自于http://byrx.net
评论关闭