【Python】命令行进度条模拟
2015-12-16 10:36
495 查看
#!/usr/bin/python import sys import time print "#### START ####" for i in range(101): sys.stdout.write('\r') sys.stdout.write("[%s>%s] %s" % ('-'*i, ' '*(100-i),str(i)+'%')) sys.stdout.flush() time.sleep(0.1) print "" print "#### END ####"
效果图如下
有兴趣的可以试着写写,玩下
相关文章推荐
- ice python lib编译
- python读书笔记-django架站过程总结(from the django book)
- 解决python进程池中无法使用multiprocessing.Queue
- [No000064]python 变量命名规范
- 简单的python爬虫——贴吧上取邮箱
- python round() round函数
- [No000063]Python格式化输出
- python连接Mysql操作
- Windows Python Extension Packages
- python --批量重命名文件名
- Windows下Python添加库(模块)路径
- Ubuntu选择python版本
- php之与python进行socket通信
- Python爬虫入门案例:获取百词斩已学单词列表
- python_类包装
- python编码问题1
- 【Python 第9课】random
- 【Python 第10课】 变量2
- 【Python 第11课】 逻辑判断
- 【Python 第8课】while