One way of doint this is as follows:
from datetime import datetime, timedelta
d1 = '04-2012'
d2 = '05-2014'
t1 = datetime.strptime(d1, "%m-%Y")
t2 = datetime.strptime(d2, "%m-%Y")
delta = timedelta(days=20)
out_dates = []
while t1 <= t2:
date_str = t1.strftime('%m-%Y')
if date_str not in out_dates:
out_dates.append(date_str)
t1 += delta
print(out_dates)
% gives: ['04-2012', '05-2012', '06-2012', '07-2012', '08-2012', '09-2012', '10-2012', '11-2012', '12-2012', '01-2013', '02-2013', '03-2013', '04-2013', '05-2013', '06-2013', '07-2013', '08-2013', '09-2013', '10-2013', '11-2013', '12-2013', '01-2014', '02-2014', '03-2014', '04-2014', '05-2014']
It will print by days, but you can make later filter it only to months and years.