Skip to content

Instantly share code, notes, and snippets.

View c060604's full-sized avatar
🚀

c060604 c060604

🚀
  • Guangzhou, China
View GitHub Profile
@c060604
c060604 / validate_code.py
Created October 20, 2015 01:20 — forked from pylemon/validate_code.py
django: validate code
#coding=utf-8
import random
from PIL import Image, ImageDraw, ImageFont, ImageFilter
_letter_cases = "abcdefghjkmnpqrstuvwxy" # 小写字母,去除可能干扰的i,l,o,z
_upper_cases = _letter_cases.upper() # 大写字母
_numbers = ''.join(map(str, range(3, 10))) # 数字
init_chars = ''.join((_letter_cases, _numbers))