captcha.py 472 B

123456789101112131415161718
  1. import pyfiglet
  2. import os
  3. chars = ['a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z']
  4. def randomification(chars):
  5. captcha = list()
  6. while len(captcha) != 3:
  7. char = int(str(list(os.urandom(1))[0]))
  8. if char > 0 and char <= 25:
  9. captcha.append(chars[char])
  10. ASCII = pyfiglet.figlet_format(str(captcha[0])+str(captcha[1])+str(captcha[2]))
  11. print(ASCII)
  12. randomification(chars)