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 + ascii_letters + punctuation + whitespace
import string
all_key = string.ascii_letters + string.digits + string.punctuation
print(all_key)
print(len(all_key)) 标签:digits,punctuation,letters,string,py,key,ascii,常量 From: https://www.cnblogs.com/sangern/p/17383431.html