#coding:utf-8 import random import string import MySQLdb def gen_charint(filename, width =4, num=5): f = open(filename, 'wb') charint = string.digits + string.letters for i in range(num): verify = [random.choice(charint) for j in range(width)] verify