Created
December 15, 2016 18:49
-
-
Save mila/b65d420825956199733d9b9d85bcf7b1 to your computer and use it in GitHub Desktop.
This file contains 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 datetime | |
start = datetime.date(2016, 11, 1) | |
stop = datetime.date(2016, 12, 1) | |
delta = datetime.timedelta(days=1) | |
tpl = "year=%(year)04d/month=%(month)02d/week=%(week)02d/day=%(day)02d" | |
date = start | |
while date < stop: | |
print tpl % { | |
'year': date.year, | |
'month': date.month, | |
'day': date.day, | |
'week': date.isocalendar()[1], | |
} | |
date += delta |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment