Skip to content

Instantly share code, notes, and snippets.

@muhammadanas0716
Created October 29, 2022 09:48
Show Gist options
  • Save muhammadanas0716/e431599d61698babe7958706a574e9b2 to your computer and use it in GitHub Desktop.
Save muhammadanas0716/e431599d61698babe7958706a574e9b2 to your computer and use it in GitHub Desktop.
Creating Captchas with Python
from captcha.image import ImageCaptcha
# Set the image size
image = ImageCaptcha(width = 400, height = 200)
# Specify text for the Captcha
captcha_text = "Captcha_PYTHON"
# Generate the image with the given text
data = image.generate(captcha_text)
# Create an image
image.write(captcha_text, "Captcha_Made_With_Python.png")
# Load & Show
from PIL import Image
Image.open("Captcha_Made_With_Python.png")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment