具体代码如下所示:

#coding:utf8
import random,wx
def password(event):
  a = [chr(i) for i in range(97,123)]
  b = [chr(i) for i in range(65,91)]
  c = ['0','1','2','3','4','5','6','7','8','9']
  d = ['!','@','#','$','%','^','&','*','(',')','=','_','+','/','"color: #ff0000">ps:下面看下python密码生成器

'''
随机密码生成器
该生成器用于生成6位随机密码,包含A-Z, a-z , 0-9 , - + = @ $ % & ^
'''
import random
#定义密码生成函数
def pass_generator(n):
  lst1 = list(range(65,91))
  lst2 = list(range(97,123))
  lst3 = list(range(10))
  lst4 = ['+','-','=','@','#','$','%','^']
  s1 = ''.join(chr(c) for c in lst1)
  s2 = ''.join(chr(c) for c in lst2)
  s3 = ''.join(str(i) for i in lst3)
  s4 = ''.join( c for c in lst4)
  s = s1 + s2 + s3 + s4
  p = ''
  for _ in range(n):
    p += random.choice(s)
  return p
print(pass_generator(32))

总结

以上所述是小编给大家介绍的python2.7实现图形密码生成器的实例代码,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!
如果你觉得本文对你有帮助,欢迎转载,烦请注明出处,谢谢!

广告合作:本站广告合作请联系QQ:858582 申请时备注:广告合作(否则不回)
免责声明:本站资源来自互联网收集,仅供用于学习和交流,请遵循相关法律法规,本站一切资源不代表本站立场,如有侵权、后门、不妥请联系本站删除!