http://stackoverflow.com/questions/2823316/generate-a-random-letter-in-python
>>> import random >>> import string >>> random.choice(string.ascii_letters) 'g'
>>> import string >>> string.letters 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' >>> import random >>> random.choice(string.letters) 'j'
我觉得自己搞定义字符串,比通过string模块好吧
数字string.digits
string模块有各种可用字符集的分类,可以参考