import datetime
oneday = datetime.timedelta(days=1)
def themonth(year, month):
days = [datetime.date(year, month, 1),]
for x in xrange(32):
d = days[0]+x*oneday
if d.month == days[0].month:
days.append(d)
return themonth
today = datetime.date.today()
thismonth = themonth(today.year, today.month)
print thismonth[0].day # 本月第一天是多少号
print thismonth[-1].day # 最后一天是多少号
追问我q505821739.你能加我下么。高手
追答sorry, 公司网络环境不允许即时通讯 :(
在百度hi里联系吧