python使用calendar输出指定年份全年日历的方法

yipeiwu_com6年前Python基础

本文实例讲述了python使用calendar输出指定年份全年日历的方法。分享给大家供大家参考。具体实现方法如下:

import calendar
print "Show a given years monthly calendar"
print ''
year = int(raw_input("Enter the year"))
print ''
calendar.prcal(year)
print ''

希望本文所述对大家的Python程序设计有所帮助。

相关文章

pytorch实现mnist数据集的图像可视化及保存

pytorch实现mnist数据集的图像可视化及保存

如何将pytorch中mnist数据集的图像可视化及保存 导出一些库 import torch import torchvision import torch.utils.data...

用Python实现数据的透视表的方法

在处理数据时,经常需要对数据分组计算均值或者计数,在Microsoft Excel中,可以通过透视表轻易实现简单的分组运算。而对于更加复杂的分组运算,Python中pandas包可以帮助...

python验证码识别实例代码

本文研究的主要是Python验证码识别的相关代码,具体如下。 Talk is cheap, show you the Code! import numpy as np import...

python给微信好友定时推送消息的示例

如下所示: from __future__ import unicode_literals from threading import Timer from wxpy import...

python浪漫表白源码

python浪漫表白源码

要知道我们程序猿也是需要浪漫的,小博我之前在网上搜寻了很多代码,确发现好多都不是最新的,所以自己就整理了一下代码,现在与广大博友们分享下 我们需要用到的包 使用pip install...