python 验证码
来源:互联网 发布:伊朗空军实力知乎 编辑:程序博客网 时间:2024/05/21 12:48
#简单的#!/usr/bin/env python# -*- coding:utf-8 -*-# # python 2.7.0import randomglobal verification_codeverification_code = ""def generate_verification_code(Get_Len = 4):#默认生成4位的验证码 for i in range(0,Get_Len): NumArr = random.randrange(0,5) if NumArr == 0: Nums = random.randrange(65,79)#大写字母,不含O elif NumArr == 1: Nums = random.randrange(80,91)#大写字母,不含O elif NumArr == 2: Nums = random.randrange(48,58)#数字 elif NumArr == 3: Nums=random.randrange(97,111)#小写字母,不含o elif NumArr == 4: Nums = random.randrange(112,123)#小写字母,不含o global verification_code verification_code = verification_code + chr(Nums)def Check_verification_code(): while 1: a=raw_input("请输入验证码") if a == verification_code.lower(): print "欢迎登录" break elif a== verification_code: print "欢迎登录" break else: print("验证码不正确,请重新输入") continuegenerate_verification_code()print(verification_code)Check_verification_code()
0 0
- [python]python验证码识别
- python 识别验证码
- python 中文验证码
- python 验证码识别
- python生成验证码
- python验证码识别
- python验证码识别
- Python生成验证码
- Python生成验证码
- 《python识别验证码》
- python 验证码识别
- Python图片验证码
- Python 爬验证码
- python 识别验证码
- Python验证码识别
- Python 验证码识别
- python 验证码
- python 识别验证码
- CSDN插入图片
- URL中的?和&
- 天使
- 解决 Must have one-pixel frame that is either transparent or white
- 关于登录的自己总结
- python 验证码
- macvtap介绍
- flume-ng配置文件详解(二)
- 程序猿媳妇儿注意事项
- 学习Collections对list做排序
- JQuery中$.ajax()方法参数详解
- 朴素贝叶斯原理及Python实现
- 第十二周oj题目输出已经交换的两个数
- iPhone通讯录底部不显示联系人的数量