9,10,11,12,1第一学期2,3,4,5,6,7第二学期其中8月份放假,暂且放入第一学期。因为大部分学校都选在8月底开学importdatetimedefgetXNandXQ():now=datetime.datetime.now()year=int(now.strftime("%Y"))month=int(now.strftime("%m"))ifmonth>=2andmonth<8:xn="%d-%d"%(year-1,year)xq=2elifmonth>=8:xn="%d-%d"%(year,year+1)xq=1else:xn="%d-%d"%(year-1,year)xq=1returnxn,xqdefgetXNandXQByYM(year,month):ifmonth>=2andmonth<8:xn="%d-%d"%(year-1,year)xq=2elifmonth>=8:xn="%d-%d"%(year,year+1)xq=1else:xn="%d-%d"%(year-1,year)xq=1returnxn,xq不知上面的代码是否合适
红糖糍粑
相关分类