Calendar 是python 日历模块,此模块的函数都是日历相关的,例如打印某月的字符月历,星期之类的模块,下面剖析python Calendar 模块导入及用法。

1,python导入日历模块

    import calendar

2,日历模块的函数

   calendar.firstweekday( ) 星期

   calendar.leapdays(y1,y2)

    calendar.month(year,month,w=2,l=1)

     calendar.setfirstweekday(weekday)

   calendar.weekday(year,month,day)

星期一是默认的每周第一天,星期天是默认的最后一天。更改设置需调用calendar.setfirstweekday()函数。

文章来自 www.96net.com.cn

相关文章:

  • 2022-12-23
  • 2021-10-02
  • 2022-12-23
  • 2021-08-05
  • 2021-08-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-11-22
  • 2021-12-16
  • 2022-12-23
  • 2021-10-19
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案