Created
January 4, 2018 21:36
-
-
Save carlynorama/df231681de50b2098b2a2d18f57abdbf to your computer and use it in GitHub Desktop.
Playing around with Python 2.7 Calendar Module
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import calendar | |
| #https://docs.python.org/2/library/calendar.html | |
| print(calendar.weekheader(5)) | |
| calendar.prcal(2018) | |
| year = 2018 | |
| month = 2 | |
| #week = 1 | |
| calendar.setfirstweekday(calendar.SATURDAY) | |
| my_cal = calendar.Calendar(6) | |
| for w in my_cal.monthdatescalendar(year, month): | |
| for d in w: | |
| print(d) | |
| my_cal = calendar.Calendar(6) | |
| for w in my_cal.monthdays2calendar(year, month): | |
| for d in w: | |
| print(d) | |
| #print(calendar.monthdays2calendar(year, month)) | |
| #calendar.prweek(year, month) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment