Skip to content

Instantly share code, notes, and snippets.

Created Jul 26, 2020
What would you like to do?
from captcha.image import ImageCaptcha
import string
import random
text = ''.join(random.choice(string.ascii_uppercase + string.ascii_lowercase + string.digits) for _ in range(10))
image = ImageCaptcha()
data = image.generate(text)
image.write(text, 'captcha.png')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment