首页 > 编程语言 > 详细

python写的一个验证码小程序

时间:2015-10-15 06:31:02      阅读:294      评论:0      收藏:0      [点我收藏+]

 

 __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写的一个验证码小程序

原文:http://liangey.blog.51cto.com/9097868/1702983

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!