python写的一个验证码小程序
2015-10-14 22:29
701 查看
__author__ = 'ley' #导入random模块 import random checkcode='' for i in range(4): #print(i) current=random.randrange(0,4) #print(current) if current !=i: #chr65-90为:A-Z字符 temp=chr(random.randint(65,90)) #print(temp) else: temp=random.randint(0,9) #print(temp) checkcode+=str(temp) print(checkcode)
本文出自 “9527” 博客,请务必保留此出处http://liangey.blog.51cto.com/9097868/1702983
相关文章推荐
- 【Python】Learn Python the hard way, ex38 列表操作
- 基于scrapy的开发
- python 生成测试数据点(带有标签的线性可分和线性不可分)
- 关于essay的使用问题
- <LeetCode><Easy>226Invert a binary tree
- python视频教程大全集下载啦
- python requests遭遇死锁小记
- <LeetCode><Easy> 228 Summary Ranges
- Python 遍历目录找出包含指定字符串的文件夹
- Python 遍历目录找出包含指定字符串的文件夹
- [Python]模拟键盘同时按下几个按键
- Python 注释
- Python lambda函数
- Python学习(二) 正则表达式
- python的range()函数用法
- 记录学习Python过程中的各种坑
- Python 网页爬虫
- python闭包的注意点
- Python操作MySQL数据库示例
- pylucene在python2.7下的安装