1from datetime import date
2d0 = date(2017, 8, 18)
3d1 = date(2017, 10, 26)
4delta = d1 - d0
5print(delta.days)
1from datetime import date, timedelta
2
3sdate = date(2008, 8, 15) # start date
4edate = date(2008, 9, 15) # end date
5
6delta = edate - sdate # as timedelta
7
8for i in range(delta.days + 1):
9 day = sdate + timedelta(days=i)
10 print(day)