def iter_period(start, end, period):
 period_start = start
 increment = datetime.timedelta(seconds=period)
 for i in xrange(int(math.ceil((timeutils.delta_seconds(start, end) / float(period))))):
  next_start = (period_start + increment)
  (yield (period_start, next_start))
  period_start = next_start

def iter_period ( start , end , period ) : period_start = start increment = datetime . timedelta ( seconds = period ) for i in xrange ( int ( math . ceil ( ( timeutils . delta_seconds ( start , end ) / float ( period ) ) ) ) ) : next_start = ( period_start + increment ) ( yield ( period_start , next_start ) ) period_start = next_start
split a time from start to end in periods of a number of seconds .