小功能函数记录-指定位数的随机码生成

 1 # -*- coding:utf-8 -*-
 2 
 3 __autor__ = "在路上_UP"
 4 
 5 from random import choice
 6 import string
 7 
 8 def GenPasswd(length=8,chars=string.ascii_letters+string.digits):
 9     return ''.join([ choice(chars) for i in range(length)])
10 password = []
11 for i in range(10000):
12     password.append(GenPasswd(16))
13     print (GenPasswd(16))
14 print(len(password))

 

posted @ 2018-01-10 14:32  在路上-UP  阅读(166)  评论(0编辑  收藏  举报