python的内置库string是个好东西,使用string可以用来生成密码,或者惊喜密码强度检测;
随机生成密码
说到随机,就不能不提python中的另一个内置库random;
random是一个随机数函数,包含多个生成随机数的方法:
string是python中一个内置的字符串;
whitespace = ' \t\n\r\v\f'
ascii_lowercase = 'abcdefghijklmnopqrstuvwxyz'
ascii_uppercase = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
ascii_letters = ascii_lowercase + ascii_uppercase
digits = '0123456789'
hexdigits = digits + 'abcdef' + 'ABCDEF'
octdigits = '01234567'
punctuation = r"""!"#$%&'()*+,-./:;<=>?@[\]^_`{|}~"""
printable = digits +