Calendar模块有很广泛的方法用来处理年历和月历,例如打印某月的月历:

import calendar

cal = calendar.month(2017, 10)
print ("以下输出2017年10月份的日历:")
print (cal)

 

 

输出如下:

以下输出2017年10月份的日历:
    October 2017
Mo Tu We Th Fr Sa Su
                   1
 2  3  4  5  6  7  8
 9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31


***Repl Closed***

 

相关文章:

  • 2021-11-09
  • 2021-12-26
  • 2021-12-17
  • 2021-12-07
  • 2022-12-23
  • 2021-11-09
  • 2022-01-28
  • 2021-12-28
猜你喜欢
  • 2022-12-23
  • 2021-07-07
  • 2021-07-03
  • 2022-02-08
  • 2021-12-29
  • 2021-12-04
  • 2022-12-23
相关资源
相似解决方案