from captcha.image import ImageCaptcha
import random
import string
from tqdm import tqdm
image = ImageCaptcha()
CHAR_SET = [c for c in 'qwertyuiopasdfghjklzxcvbnm']
for i in tqdm(range(1000)):
a= ''.join(random.choices(CHAR_SET, k=4))
name = ''.join(random.choices(string.ascii_lowercase, k=19))
image.write(answer, 'images/%s_%s.png' % (a, name))
网友评论