728x90
๋ฐ์ํ
๋ชจ๋ ์ค์น
pip install captcha
๊ธ์ ์์ฑ ์์
# Import the following modules
from captcha.image import ImageCaptcha
# Create an image instance of the given size
image = ImageCaptcha(width = 280, height = 90)
# Image captcha text
captcha_text = 'GeeksforGeeks'
# generate the image of the given text
data = image.generate(captcha_text)
# write the image on the given file and save it
image.write(captcha_text, 'CAPTCHA.png')
์ค๋์ค ์์ฑ ์์
# Import the following modules
from captcha.audio import AudioCaptcha
# Create an audio instance
audio = AudioCaptcha()
# Audio captcha text
captcha_text = "5454"
# generate the audio of the given text
audio_data = audio.generate(captcha_text)
# Give the name of the audio file
audio_file = "audio"+captcha_text+'.wav'
# Finally write the audio file and save it
audio.write(captcha_text, audio_file)
์ถ์ฒ:
https://www.geeksforgeeks.org/generate-captcha-using-python/
Generate Captcha Using Python - GeeksforGeeks
A Computer Science portal for geeks. It contains well written, well thought and well explained computer science and programming articles, quizzes and practice/competitive programming/company interview Questions.
www.geeksforgeeks.org
728x90
๋ฐ์ํ