Python String模块详解
1 >>> import string 2 3 >>> string.ascii_letters 4 5 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' 6 7 >>> string.ascii_lowercase 8 9 'abcdefghijklmnopqrstuvwxyz' 10 11 >>> string.ascii_uppercase 12 13 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 14 15 >>> string.digits 16 17 '0123456789' 18 19 >>> string.hexdigits 20 21 '0123456789abcdefABCDEF' 22 23 >>> string.letters 24 25 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz' 26 27 >>> string.lowercase 28 29 'abcdefghijklmnopqrstuvwxyz' 30 31 >>> string.uppercase 32 33 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 34 35 >>> string.octdigits 36 37 '01234567' 38 39 >>> string.punctuation 40 41 '!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~' 42 43 >>> string.printable 44 45 '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!"#$%&\'()*+,-./:;<=>?@[\\]^_`{|}~ \t\n\r\x0b\x0c' 46 47 >>> string.whitespace 48 49 '\t\n\x0b\x0c\r