I\'m trying to generate a sliding window function in Python. I figured out how to do it but not all inside the function. itertools, yield, and iter() are entirely new to me
You mean you want to do this ? :
a='abcdefg' b = [a[i:i+3] for i in xrange(len(a)-2)] print b ['abc', 'bcd', 'cde', 'def', 'efg']