1. 程式人生 > >python中如何打印某月日歷

python中如何打印某月日歷

打印 color transform ans one ack 處理 sof none

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***

python中如何打印某月日歷