In <[email protected]> PieGuy
<[email protected]> writes:
> Starting on any day/date, I would like to create a one year list, by week
> (start date could be any day of week). Having a numerical week index in
> front of date, ie 1-52, would be a bonus.
> ie, 1. 6/4/2013
> 2. 6/11/2013
> 3. 6/18/2013....etc to # 52.
> And to save that result to a file.
> Moving from 2.7 to 3.3
> TIA
from datetime import date, timedelta
the_date = date(year=2013, month=6, day=4)
print "%d. %s" % (1, the_date)
for n in range(2, 53):
the_date = the_date + timedelta(days=7)
print "%d. %s" % (n, the_date)
--
John Gordon A is for Amy, who fell down the stairs
[email protected] B is for Basil, assaulted by bears
-- Edward Gorey, "The Gashlycrumb Tinies"
--
http://mail.python.org/mailman/listinfo/python-list