๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ
๐Ÿ‘จ๐Ÿผ‍๐Ÿ’ป๊ฐœ๋ฐœ/ํŒŒ์ด์ฌ

ํŒŒ์ด์ฌ - ์บก์ฑ  ์ƒ์„ฑ๊ธฐ(captcha)

by Janger 2023. 3. 12.
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
๋ฐ˜์‘ํ˜•