calendar模块的作用
calendar模块定义了Calendar类,其中封装了一些值的计算,如给定的一个月或一年中的周日期。另外,TextCalendar和HTMLCalendar类可以生成经过预格式化的输出。
1、指定年月,显示出日期
import calendar c = calendar.TextCalendar(calendar.SUNDAY) c.prmonth(2020,5)
calendar模块的作用
calendar模块定义了Calendar类,其中封装了一些值的计算,如给定的一个月或一年中的周日期。另外,TextCalendar和HTMLCalendar类可以生成经过预格式化的输出。
1、指定年月,显示出日期
import calendar c = calendar.TextCalendar(calendar.SUNDAY) c.prmonth(2020,5)
相关文章: