import calendar
1、星期
(1)calendar.day_name 星期的全称
print calendar.day_name
for i in calendar.day_name:
print i
结果:
<calendar._localized_day instance at 0x02A6F788>
Monday
Tuesday
Wednesday
Thursday
Friday
Saturday
Sunday
(2)calendar.day_abbr 星期的简称
(3)calendar.month_name:月份的全称
(4)判断是否是闰年:calendar.isleap(2012) 结果:True
(5)打印某一个月的日历:使用比较多
calendar.month(2017,6)
结果:
June 2017
Mo Tu We Th Fr Sa Su
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30
(6)显示某一年的日历
calendar.calendar(2017)

Python之时间:calender模块(日历)的更多相关文章

  1. Python 日期时间处理模块学习笔记

    来自:标点符的<Python 日期时间处理模块学习笔记> Python的时间处理模块在日常的使用中用的不是非常的多,但是使用的时候基本上都是要查资料,还是有些麻烦的,梳理下,便于以后方便的 ...

  2. Python时间calender模块介绍

    获取某月日历 Calendar模块有很广泛的方法用来处理年历和月历,例如打印某月的月历: #!/usr/bin/python # -*- coding: UTF-8 -*- import calend ...

  3. python基础===时间处理模块

    时间模块 Python中有很多方便我们处理时间信息的模块 time 模块 datetime 模块 pytz 模块 dateutil 模块 这里我们着重介绍的是前两种 time模块 time.time( ...

  4. 【转】Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历))

    Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历)) 本文由 Luzhuo 编写,转发请保留该信息. 原文: http://blog. ...

  5. 【转载】Python日期时间模块datetime详解与Python 日期时间的比较,计算实例代码

    本文转载自脚本之家,源网址为:https://www.jb51.net/article/147429.htm 一.Python中日期时间模块datetime介绍 (一).datetime模块中包含如下 ...

  6. Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历))

    Python3 日期时间 相关模块(time(时间) / datatime(日期时间) / calendar(日历)) 本文由 Luzhuo 编写,转发请保留该信息. 原文: http://blog. ...

  7. python时间-time模块

    time是python自带的模块,用于处理时间问题,提供了一系列的操作时间的函数. 以下说明针对于 python2.7,其他版本可能有所差异. 模块提供了两个种表示时间的格式: 1.时间戳,是以秒表示 ...

  8. python模块:时间处理模块

    http://blog.csdn.net/pipisorry/article/details/53067168 常用python自带时间处理模块 python自带的时间处理模块参考[操作系统服务:ti ...

  9. 【转】Python之日期与时间处理模块(date和datetime)

    [转]Python之日期与时间处理模块(date和datetime) 本节内容 前言 相关术语的解释 时间的表现形式 time模块 datetime模块 时间格式码 总结 前言 在开发工作中,我们经常 ...

  10. Python时间time模块介绍

    一.明确时间元组 二.测试代码#!/usr/bin/env python # -- coding: utf-8 --' """ 时间模块,time的相关操作与测试 &qu ...

随机推荐

  1. windows平台下MongoDB安装和环境搭建

    下载安装包或者压缩包 添加db存储和日志存储文件夹 添加服务.配置环境变量.启动Mongo 本例:安装路径:D:Program Files/MongoDB 配置文件的路径:D:MongoDB 一.安装 ...

  2. Oracle下如何收集 Systemstate dump

    2: dump (不包括lock element) 10: dump 11: dump + global cache of RAC 256: short stack (函数堆栈) 258: 256+2 ...

  3. oc不可变数组创建

    //创建数组 //1.快速创建数组  @[] NSArray *week=@[@"MON",@"TUE",@"WED",@"THU ...

  4. vue axios 攻略

    Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中. 特点: 从浏览器中创建 XMLHttpRequest 从 node.js 发出 http 请求 支持 ...

  5. Dungeon Master POJ - 2251 (搜索)

    Dungeon Master Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 48605   Accepted: 18339 ...

  6. linux配置邮箱服务

    配置邮箱服务Linux常见的邮箱客户端是mail或mutt:服务端有sendmail服务(centos 5).postfix服务(centos 6).这里我们不使用本地的邮件服务,而是使用本地的邮件客 ...

  7. A Bug's Life(削弱版食物链)

    Description Background  Professor Hopper is researching the sexual behavior of a rare species of bug ...

  8. python3 练习题100例 (十四)

    今天逛贴吧,看到有人求助,做了一下.请大家指正! #!/usr/bin/env python3 # -*- coding: utf-8 -*- __author__ = 'Fan Lijun' imp ...

  9. C++从键盘读入数组并存储

    C++从键盘读取任意长度的数组,现总结如下: //读取指定长度的数组 int main() { int n = 0; cin >> n; vector<int> p(n); f ...

  10. BFS:HDU-1072-Nightmare

    Nightmare Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total ...