文件名称:python生成4位随机验证码
文件大小:236B
文件格式:PY
更新时间:2024-08-11 04:41:55
python
from captcha.image import ImageCaptcha import random as r ic = ImageCaptcha() l = [] for i in range(4): j = r.randint(0, 9) l.append(j) print(l) s = "{}{}{}{}".format(*l) ic.write(s, 'test' + '.png', format='png')