Skip to content

Instantly share code, notes, and snippets.

@fanzeyi
Created July 16, 2012 13:35
Show Gist options
  • Save fanzeyi/3122769 to your computer and use it in GitHub Desktop.
Save fanzeyi/3122769 to your computer and use it in GitHub Desktop.
import calendar
START_YEAR = 2012
END_YEAR = 2012
START_MONTH = 7
END_MONTH = 7
cal = calendar.Calendar()
result = ["&year=%d&month=%d&day=%d" % (year, month, day) \
for year in range(START_YEAR, END_YEAR + 1) \
for month in range(START_MONTH, END_MONTH+1) \
for day, weekname in cal.itermonthdays2(year, month) \
if day != 0 and weekname == 0]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment