Sunday 26 June 2016

Python: Calendar: iterweekdays: Get week day numbers iterweekdays()


Returns an iterator for the numbers associated for the week.
>>> import calendar
>>> cal1=calendar.Calendar(0)
>>> iter1=cal1.iterweekdays()
>>> for dayNum in iter1:
...     print(dayNum)
... 
0
1
2
3
4
5
6
>>> 
>>>
>>> 
>>> cal2=calendar.Calendar(5)
>>> iter2=cal2.iterweekdays()
>>> for dayNum in iter2:
...     print(dayNum)
... 
5
6
0
1
2
3
4



Previous                                                 Next                                                 Home

No comments:

Post a Comment