Skip to content

Instantly share code, notes, and snippets.

@Allwin12
Created July 26, 2020 14:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Allwin12/84d097bafb3d63c8fda0c75aa37f62b3 to your computer and use it in GitHub Desktop.
Save Allwin12/84d097bafb3d63c8fda0c75aa37f62b3 to your computer and use it in GitHub Desktop.
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