python生成随机验证码(中文验证码)示例

qq_21710 22 0 PDF 2021-02-23 22:02:09

复制代码 代码如下:# -*- coding: utf-8 -*-import Image,ImageDraw,ImageFontimport randomimport math, string class RandomChar(): “””用于随机生成汉字””” @staticmethod def Unicode(): val = random.randint(0x4E00, 0x9FBF) return unichr(val) @staticmethod def GB2312(): head = random.randint(0xB0, 0xCF)

用户评论
请输入评论内容
评分:
暂无评论