Stepping through date in Python
Question: Let's say I have a starting date of `datetime(2007, 2, 15)`.

I want to step this date in a loop so that it's advanced to the 1st and 15th
of each month.

So `datetime(2007, 2, 15)` would step to `datetime(2007, 3, 1)`.

In the next iteration, it would step to `datetime(2007, 3, 15)`... then to
`datetime(2007, 4, 1)` and so forth.

Is there any possible way to do this with `timedelta` or `dateutils`
considering that, the number of days it has to step by, continuously changes?


Answer: 
    from datetime import datetime
    for m in range(1, 13):
        for d in (1, 15):
            print str(datetime(2013, m, d))
    
    2013-01-01 00:00:00
    2013-01-15 00:00:00
    2013-02-01 00:00:00
    2013-02-15 00:00:00
    2013-03-01 00:00:00
    2013-03-15 00:00:00
    2013-04-01 00:00:00
    2013-04-15 00:00:00
    2013-05-01 00:00:00
    2013-05-15 00:00:00
    2013-06-01 00:00:00
    2013-06-15 00:00:00
    2013-07-01 00:00:00
    2013-07-15 00:00:00
    2013-08-01 00:00:00
    2013-08-15 00:00:00
    2013-09-01 00:00:00
    2013-09-15 00:00:00
    2013-10-01 00:00:00
    2013-10-15 00:00:00
    2013-11-01 00:00:00
    2013-11-15 00:00:00
    2013-12-01 00:00:00
    2013-12-15 00:00:00
    

I tend to work with datetime more than date objects, but you could use
datetime.date depending on your needs.

