Created
October 29, 2022 09:48
-
-
Save muhammadanas0716/e431599d61698babe7958706a574e9b2 to your computer and use it in GitHub Desktop.
Creating Captchas with Python
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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