Python 验证码生产程序和进度条程序
2016-05-20 22:25
417 查看
#验证码程序 import random ran = "" for i in range(4): value = random.randint(0,4) if value == i : ran += str(random.randint(0,9)) else: ran += chr(random.randint(65,90)) print (ran)
import sys import time fileSize = 780 #print (type(fileSize)) tranSpeed = 36.2 tranTime = int(fileSize/tranSpeed) while tranTime >0: # print (tranTime) sys.stdout.write(">") sys.stdout.flush() #默认数据输出前先放在缓存中,通过flush实现不放入缓存 time.sleep(1) tranTime -=1
相关文章推荐
- 将普通图片转化为字符画(Python)
- 爬虫xpath学习
- python
- LeetCode Word Ladder II
- Ubuntu14.04LTS下学习python2.7.6里程
- Python基础笔记
- 熟悉python中的tkinter图形包--(写一个参数计算器)
- 感知机学习算法初步1
- Python资料锦集
- Python中pydoc命令在windows下不能使用的解决办法
- Python os.popen()方法的用法
- python
- Python 进阶 —— 迭代器与生成器
- VMware workstations 12里配置Ubuntu 12.04及python环境
- Python 扫面文件夹中的文件
- 【Python自动化运维之路Day2】
- leetcode(11), Number of 1 Bits(python)
- TexturePacker批处理python
- selenium+python笔记11
- Python - Django分布式Celery使用