Monday 4 July 2016

Python: Calendar: yeardatescalendar(year, width=3)

yeardatescalendar(year, width=3)

Returns the data for given year. Returns the list of month rows. Each month row contains up to width months (defaulting to 3).
>>> from calendar import Calendar
>>> iter=cal1.yeardatescalendar(2011, width=5)
>>> for day in iter:
...     print(day)
... 
[[[datetime.date(2010, 12, 27), datetime.date(2010, 12, 28), datetime.date(2010, 12, 29), datetime.date(2010, 12, 30), datetime.date(2010, 12, 31), datetime.date(2011, 1, 1), datetime.date(2011, 1, 2)], [datetime.date(2011, 1, 3), datetime.date(2011, 1, 4), datetime.date(2011, 1, 5), datetime.date(2011, 1, 6), datetime.date(2011, 1, 7), datetime.date(2011, 1, 8), datetime.date(2011, 1, 9)], [datetime.date(2011, 1, 10), datetime.date(2011, 1, 11), datetime.date(2011, 1, 12), datetime.date(2011, 1, 13), datetime.date(2011, 1, 14), datetime.date(2011, 1, 15), datetime.date(2011, 1, 16)], [datetime.date(2011, 1, 17), datetime.date(2011, 1, 18), datetime.date(2011, 1, 19), datetime.date(2011, 1, 20), datetime.date(2011, 1, 21), datetime.date(2011, 1, 22), datetime.date(2011, 1, 23)], [datetime.date(2011, 1, 24), datetime.date(2011, 1, 25), datetime.date(2011, 1, 26), datetime.date(2011, 1, 27), datetime.date(2011, 1, 28), datetime.date(2011, 1, 29), datetime.date(2011, 1, 30)], [datetime.date(2011, 1, 31), datetime.date(2011, 2, 1), datetime.date(2011, 2, 2), datetime.date(2011, 2, 3), datetime.date(2011, 2, 4), datetime.date(2011, 2, 5), datetime.date(2011, 2, 6)]], [[datetime.date(2011, 1, 31), datetime.date(2011, 2, 1), datetime.date(2011, 2, 2), datetime.date(2011, 2, 3), datetime.date(2011, 2, 4), datetime.date(2011, 2, 5), datetime.date(2011, 2, 6)], [datetime.date(2011, 2, 7), datetime.date(2011, 2, 8), datetime.date(2011, 2, 9), datetime.date(2011, 2, 10), datetime.date(2011, 2, 11), datetime.date(2011, 2, 12), datetime.date(2011, 2, 13)], [datetime.date(2011, 2, 14), datetime.date(2011, 2, 15), datetime.date(2011, 2, 16), datetime.date(2011, 2, 17), datetime.date(2011, 2, 18), datetime.date(2011, 2, 19), datetime.date(2011, 2, 20)], [datetime.date(2011, 2, 21), datetime.date(2011, 2, 22), datetime.date(2011, 2, 23), datetime.date(2011, 2, 24), datetime.date(2011, 2, 25), datetime.date(2011, 2, 26), datetime.date(2011, 2, 27)], [datetime.date(2011, 2, 28), datetime.date(2011, 3, 1), datetime.date(2011, 3, 2), datetime.date(2011, 3, 3), datetime.date(2011, 3, 4), datetime.date(2011, 3, 5), datetime.date(2011, 3, 6)]], [[datetime.date(2011, 2, 28), datetime.date(2011, 3, 1), datetime.date(2011, 3, 2), datetime.date(2011, 3, 3), datetime.date(2011, 3, 4), datetime.date(2011, 3, 5), datetime.date(2011, 3, 6)], [datetime.date(2011, 3, 7), datetime.date(2011, 3, 8), datetime.date(2011, 3, 9), datetime.date(2011, 3, 10), datetime.date(2011, 3, 11), datetime.date(2011, 3, 12), datetime.date(2011, 3, 13)], [datetime.date(2011, 3, 14), datetime.date(2011, 3, 15), datetime.date(2011, 3, 16), datetime.date(2011, 3, 17), datetime.date(2011, 3, 18), datetime.date(2011, 3, 19), datetime.date(2011, 3, 20)], [datetime.date(2011, 3, 21), datetime.date(2011, 3, 22), datetime.date(2011, 3, 23), datetime.date(2011, 3, 24), datetime.date(2011, 3, 25), datetime.date(2011, 3, 26), datetime.date(2011, 3, 27)], [datetime.date(2011, 3, 28), datetime.date(2011, 3, 29), datetime.date(2011, 3, 30), datetime.date(2011, 3, 31), datetime.date(2011, 4, 1), datetime.date(2011, 4, 2), datetime.date(2011, 4, 3)]], [[datetime.date(2011, 3, 28), datetime.date(2011, 3, 29), datetime.date(2011, 3, 30), datetime.date(2011, 3, 31), datetime.date(2011, 4, 1), datetime.date(2011, 4, 2), datetime.date(2011, 4, 3)], [datetime.date(2011, 4, 4), datetime.date(2011, 4, 5), datetime.date(2011, 4, 6), datetime.date(2011, 4, 7), datetime.date(2011, 4, 8), datetime.date(2011, 4, 9), datetime.date(2011, 4, 10)], [datetime.date(2011, 4, 11), datetime.date(2011, 4, 12), datetime.date(2011, 4, 13), datetime.date(2011, 4, 14), datetime.date(2011, 4, 15), datetime.date(2011, 4, 16), datetime.date(2011, 4, 17)], [datetime.date(2011, 4, 18), datetime.date(2011, 4, 19), datetime.date(2011, 4, 20), datetime.date(2011, 4, 21), datetime.date(2011, 4, 22), datetime.date(2011, 4, 23), datetime.date(2011, 4, 24)], [datetime.date(2011, 4, 25), datetime.date(2011, 4, 26), datetime.date(2011, 4, 27), datetime.date(2011, 4, 28), datetime.date(2011, 4, 29), datetime.date(2011, 4, 30), datetime.date(2011, 5, 1)]], [[datetime.date(2011, 4, 25), datetime.date(2011, 4, 26), datetime.date(2011, 4, 27), datetime.date(2011, 4, 28), datetime.date(2011, 4, 29), datetime.date(2011, 4, 30), datetime.date(2011, 5, 1)], [datetime.date(2011, 5, 2), datetime.date(2011, 5, 3), datetime.date(2011, 5, 4), datetime.date(2011, 5, 5), datetime.date(2011, 5, 6), datetime.date(2011, 5, 7), datetime.date(2011, 5, 8)], [datetime.date(2011, 5, 9), datetime.date(2011, 5, 10), datetime.date(2011, 5, 11), datetime.date(2011, 5, 12), datetime.date(2011, 5, 13), datetime.date(2011, 5, 14), datetime.date(2011, 5, 15)], [datetime.date(2011, 5, 16), datetime.date(2011, 5, 17), datetime.date(2011, 5, 18), datetime.date(2011, 5, 19), datetime.date(2011, 5, 20), datetime.date(2011, 5, 21), datetime.date(2011, 5, 22)], [datetime.date(2011, 5, 23), datetime.date(2011, 5, 24), datetime.date(2011, 5, 25), datetime.date(2011, 5, 26), datetime.date(2011, 5, 27), datetime.date(2011, 5, 28), datetime.date(2011, 5, 29)], [datetime.date(2011, 5, 30), datetime.date(2011, 5, 31), datetime.date(2011, 6, 1), datetime.date(2011, 6, 2), datetime.date(2011, 6, 3), datetime.date(2011, 6, 4), datetime.date(2011, 6, 5)]]]
[[[datetime.date(2011, 5, 30), datetime.date(2011, 5, 31), datetime.date(2011, 6, 1), datetime.date(2011, 6, 2), datetime.date(2011, 6, 3), datetime.date(2011, 6, 4), datetime.date(2011, 6, 5)], [datetime.date(2011, 6, 6), datetime.date(2011, 6, 7), datetime.date(2011, 6, 8), datetime.date(2011, 6, 9), datetime.date(2011, 6, 10), datetime.date(2011, 6, 11), datetime.date(2011, 6, 12)], [datetime.date(2011, 6, 13), datetime.date(2011, 6, 14), datetime.date(2011, 6, 15), datetime.date(2011, 6, 16), datetime.date(2011, 6, 17), datetime.date(2011, 6, 18), datetime.date(2011, 6, 19)], [datetime.date(2011, 6, 20), datetime.date(2011, 6, 21), datetime.date(2011, 6, 22), datetime.date(2011, 6, 23), datetime.date(2011, 6, 24), datetime.date(2011, 6, 25), datetime.date(2011, 6, 26)], [datetime.date(2011, 6, 27), datetime.date(2011, 6, 28), datetime.date(2011, 6, 29), datetime.date(2011, 6, 30), datetime.date(2011, 7, 1), datetime.date(2011, 7, 2), datetime.date(2011, 7, 3)]], [[datetime.date(2011, 6, 27), datetime.date(2011, 6, 28), datetime.date(2011, 6, 29), datetime.date(2011, 6, 30), datetime.date(2011, 7, 1), datetime.date(2011, 7, 2), datetime.date(2011, 7, 3)], [datetime.date(2011, 7, 4), datetime.date(2011, 7, 5), datetime.date(2011, 7, 6), datetime.date(2011, 7, 7), datetime.date(2011, 7, 8), datetime.date(2011, 7, 9), datetime.date(2011, 7, 10)], [datetime.date(2011, 7, 11), datetime.date(2011, 7, 12), datetime.date(2011, 7, 13), datetime.date(2011, 7, 14), datetime.date(2011, 7, 15), datetime.date(2011, 7, 16), datetime.date(2011, 7, 17)], [datetime.date(2011, 7, 18), datetime.date(2011, 7, 19), datetime.date(2011, 7, 20), datetime.date(2011, 7, 21), datetime.date(2011, 7, 22), datetime.date(2011, 7, 23), datetime.date(2011, 7, 24)], [datetime.date(2011, 7, 25), datetime.date(2011, 7, 26), datetime.date(2011, 7, 27), datetime.date(2011, 7, 28), datetime.date(2011, 7, 29), datetime.date(2011, 7, 30), datetime.date(2011, 7, 31)]], [[datetime.date(2011, 8, 1), datetime.date(2011, 8, 2), datetime.date(2011, 8, 3), datetime.date(2011, 8, 4), datetime.date(2011, 8, 5), datetime.date(2011, 8, 6), datetime.date(2011, 8, 7)], [datetime.date(2011, 8, 8), datetime.date(2011, 8, 9), datetime.date(2011, 8, 10), datetime.date(2011, 8, 11), datetime.date(2011, 8, 12), datetime.date(2011, 8, 13), datetime.date(2011, 8, 14)], [datetime.date(2011, 8, 15), datetime.date(2011, 8, 16), datetime.date(2011, 8, 17), datetime.date(2011, 8, 18), datetime.date(2011, 8, 19), datetime.date(2011, 8, 20), datetime.date(2011, 8, 21)], [datetime.date(2011, 8, 22), datetime.date(2011, 8, 23), datetime.date(2011, 8, 24), datetime.date(2011, 8, 25), datetime.date(2011, 8, 26), datetime.date(2011, 8, 27), datetime.date(2011, 8, 28)], [datetime.date(2011, 8, 29), datetime.date(2011, 8, 30), datetime.date(2011, 8, 31), datetime.date(2011, 9, 1), datetime.date(2011, 9, 2), datetime.date(2011, 9, 3), datetime.date(2011, 9, 4)]], [[datetime.date(2011, 8, 29), datetime.date(2011, 8, 30), datetime.date(2011, 8, 31), datetime.date(2011, 9, 1), datetime.date(2011, 9, 2), datetime.date(2011, 9, 3), datetime.date(2011, 9, 4)], [datetime.date(2011, 9, 5), datetime.date(2011, 9, 6), datetime.date(2011, 9, 7), datetime.date(2011, 9, 8), datetime.date(2011, 9, 9), datetime.date(2011, 9, 10), datetime.date(2011, 9, 11)], [datetime.date(2011, 9, 12), datetime.date(2011, 9, 13), datetime.date(2011, 9, 14), datetime.date(2011, 9, 15), datetime.date(2011, 9, 16), datetime.date(2011, 9, 17), datetime.date(2011, 9, 18)], [datetime.date(2011, 9, 19), datetime.date(2011, 9, 20), datetime.date(2011, 9, 21), datetime.date(2011, 9, 22), datetime.date(2011, 9, 23), datetime.date(2011, 9, 24), datetime.date(2011, 9, 25)], [datetime.date(2011, 9, 26), datetime.date(2011, 9, 27), datetime.date(2011, 9, 28), datetime.date(2011, 9, 29), datetime.date(2011, 9, 30), datetime.date(2011, 10, 1), datetime.date(2011, 10, 2)]], [[datetime.date(2011, 9, 26), datetime.date(2011, 9, 27), datetime.date(2011, 9, 28), datetime.date(2011, 9, 29), datetime.date(2011, 9, 30), datetime.date(2011, 10, 1), datetime.date(2011, 10, 2)], [datetime.date(2011, 10, 3), datetime.date(2011, 10, 4), datetime.date(2011, 10, 5), datetime.date(2011, 10, 6), datetime.date(2011, 10, 7), datetime.date(2011, 10, 8), datetime.date(2011, 10, 9)], [datetime.date(2011, 10, 10), datetime.date(2011, 10, 11), datetime.date(2011, 10, 12), datetime.date(2011, 10, 13), datetime.date(2011, 10, 14), datetime.date(2011, 10, 15), datetime.date(2011, 10, 16)], [datetime.date(2011, 10, 17), datetime.date(2011, 10, 18), datetime.date(2011, 10, 19), datetime.date(2011, 10, 20), datetime.date(2011, 10, 21), datetime.date(2011, 10, 22), datetime.date(2011, 10, 23)], [datetime.date(2011, 10, 24), datetime.date(2011, 10, 25), datetime.date(2011, 10, 26), datetime.date(2011, 10, 27), datetime.date(2011, 10, 28), datetime.date(2011, 10, 29), datetime.date(2011, 10, 30)], [datetime.date(2011, 10, 31), datetime.date(2011, 11, 1), datetime.date(2011, 11, 2), datetime.date(2011, 11, 3), datetime.date(2011, 11, 4), datetime.date(2011, 11, 5), datetime.date(2011, 11, 6)]]]
[[[datetime.date(2011, 10, 31), datetime.date(2011, 11, 1), datetime.date(2011, 11, 2), datetime.date(2011, 11, 3), datetime.date(2011, 11, 4), datetime.date(2011, 11, 5), datetime.date(2011, 11, 6)], [datetime.date(2011, 11, 7), datetime.date(2011, 11, 8), datetime.date(2011, 11, 9), datetime.date(2011, 11, 10), datetime.date(2011, 11, 11), datetime.date(2011, 11, 12), datetime.date(2011, 11, 13)], [datetime.date(2011, 11, 14), datetime.date(2011, 11, 15), datetime.date(2011, 11, 16), datetime.date(2011, 11, 17), datetime.date(2011, 11, 18), datetime.date(2011, 11, 19), datetime.date(2011, 11, 20)], [datetime.date(2011, 11, 21), datetime.date(2011, 11, 22), datetime.date(2011, 11, 23), datetime.date(2011, 11, 24), datetime.date(2011, 11, 25), datetime.date(2011, 11, 26), datetime.date(2011, 11, 27)], [datetime.date(2011, 11, 28), datetime.date(2011, 11, 29), datetime.date(2011, 11, 30), datetime.date(2011, 12, 1), datetime.date(2011, 12, 2), datetime.date(2011, 12, 3), datetime.date(2011, 12, 4)]], [[datetime.date(2011, 11, 28), datetime.date(2011, 11, 29), datetime.date(2011, 11, 30), datetime.date(2011, 12, 1), datetime.date(2011, 12, 2), datetime.date(2011, 12, 3), datetime.date(2011, 12, 4)], [datetime.date(2011, 12, 5), datetime.date(2011, 12, 6), datetime.date(2011, 12, 7), datetime.date(2011, 12, 8), datetime.date(2011, 12, 9), datetime.date(2011, 12, 10), datetime.date(2011, 12, 11)], [datetime.date(2011, 12, 12), datetime.date(2011, 12, 13), datetime.date(2011, 12, 14), datetime.date(2011, 12, 15), datetime.date(2011, 12, 16), datetime.date(2011, 12, 17), datetime.date(2011, 12, 18)], [datetime.date(2011, 12, 19), datetime.date(2011, 12, 20), datetime.date(2011, 12, 21), datetime.date(2011, 12, 22), datetime.date(2011, 12, 23), datetime.date(2011, 12, 24), datetime.date(2011, 12, 25)], [datetime.date(2011, 12, 26), datetime.date(2011, 12, 27), datetime.date(2011, 12, 28), datetime.date(2011, 12, 29), datetime.date(2011, 12, 30), datetime.date(2011, 12, 31), datetime.date(2012, 1, 1)]]]


Previous                                                 Next                                                 Home

No comments:

Post a Comment