PYTHONL Telegram 4052
🖥 Генерация CAPTCHA с помощью Python

from captcha.image import ImageCaptcha
from PIL import Image
def generate_captcha_text(length):
import string
import random
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))

def generate_captcha(captcha_length=7, save_path='CAPTCHA.png'):
image = ImageCaptcha(width=500, height=100)
captcha_text = generate_captcha_text(captcha_length)
data = image.generate(captcha_text)
image.write(captcha_text, save_path)
return captcha_text

if __name__ == '__main__':
captcha_text = generate_captcha()
print('CAPTCHA text:', captcha_text)

Image.open('CAPTCHA.png')


При желании можно добавить дополнительных эффектов и т.д., чтобы даже ChatGPT не справился

@pythonl
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥24👍147



tgoop.com/pythonl/4052
Create:
Last Update:

🖥 Генерация CAPTCHA с помощью Python

from captcha.image import ImageCaptcha
from PIL import Image
def generate_captcha_text(length):
import string
import random
return ''.join(random.choices(string.ascii_letters + string.digits, k=length))

def generate_captcha(captcha_length=7, save_path='CAPTCHA.png'):
image = ImageCaptcha(width=500, height=100)
captcha_text = generate_captcha_text(captcha_length)
data = image.generate(captcha_text)
image.write(captcha_text, save_path)
return captcha_text

if __name__ == '__main__':
captcha_text = generate_captcha()
print('CAPTCHA text:', captcha_text)

Image.open('CAPTCHA.png')


При желании можно добавить дополнительных эффектов и т.д., чтобы даже ChatGPT не справился

@pythonl

BY Python/ django




Share with your friend now:
tgoop.com/pythonl/4052

View MORE
Open in Telegram


Telegram News

Date: |

Users are more open to new information on workdays rather than weekends. For crypto enthusiasts, there was the “gm” app, a self-described “meme app” which only allowed users to greet each other with “gm,” or “good morning,” a common acronym thrown around on Crypto Twitter and Discord. But the gm app was shut down back in September after a hacker reportedly gained access to user data. Informative Activate up to 20 bots There have been several contributions to the group with members posting voice notes of screaming, yelling, groaning, and wailing in different rhythms and pitches. Calling out the “degenerate” community or the crypto obsessives that engage in high-risk trading, Co-founder of NFT renting protocol Rentable World emiliano.eth shared this group on his Twitter. He wrote: “hey degen, are you stressed? Just let it out all out. Voice only tg channel for screaming”.
from us


Telegram Python/ django
FROM American