Python日期和时间
2016-06-09 10:29
507 查看
输出当前时间
输出日历
进度条
import time#引入time模块 print time.strftime("%Y-%m-%d %H:%M:%S",time.localtime())
输出日历
import calendar; cal = calendar.month(2016,1); print cal;
进度条
import sys import time def view_bar(num, total): rate = num / total rate_num = int(rate * 100) r = '\r[%s%s]%d%%' %('=' * num, '' * (100 - num), num) sys.stdout.write(r) sys.stdout.flush() if __name__ == '__main__': for i in range(0, 101): time.sleep(0.1) view_bar(i, 100)
相关文章推荐
- Python的变量类型
- 用Supervisord管理Python进程
- Python之路【第二篇】:Python基础(一)
- python 字符编码练习
- python3实现暴力穷举博客园密码
- python中的and | or表达式
- python中的列表生成式 | 字典生成式
- leetcode之Intersection of Two Arrays II
- leetcode之 Intersection of Two Arrays
- Opencv3.0-python的那些事儿:(九)、Opencv关于如何读取大量视频帧进行处理的方法
- leetcode之Reverse Vowels of a String
- python中计算上个月和下个月的第一天的方法
- python的奇淫技巧:python的模块放在哪
- python2 浮点数操作常见“陷阱”
- python2 浮点数操作常见“陷阱”
- python2 浮点数操作常见“陷阱”
- python2 浮点数操作常见“陷阱”
- python2 浮点数操作常见“陷阱”
- python2 浮点数操作常见“陷阱”
- python2 浮点数操作常见“陷阱”