搜索了好几个python实现的万年历多有部分时间有问题,好多是来自这个代码:
复制代码 代码如下:#!/usr/bin/env python# -*- coding: utf-8 -*-”’Usage: ccal Month [4-Digit-Year] or: ccal 4-Digit-Year Month
This Python scr ipt is to show Solar and Lunar calender at thesame time. You need to have
本文实例为大家分享了python实现万年历的具体代码,供大家参考,具体内容如下
#coding:utf-8
def leap_year(year):#判断平瑞年
if year%4==0 and year0!=0 or year0==0:
return True
else:
return False
def getMonthDays(year,month):#得到每个年份每月的天数
days = 31
if month == 2 :
if leap_ye