生成16位验证码

2018-03-17  本文已影响10人  drfung
import random, string
# 生成字母池
# 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~'
char_list = string.ascii_letters + string.digits + string.punctuation

check_code = ""
for i in range(16):
    check_code += char_list[random.randint(0,len(char_list))]

print(check_code)
上一篇下一篇

猜你喜欢

热点阅读