The code below takes a string and returns a list containing the n-sized pieces of the string. For example: splitCount('aabbccdd', 2) => ['aa', 'bb', 'cc', 'dd']
def splitCount(s, count): return [''.join(x) for x in zip(*[list(s[z::count]) for z in range(count)])]
This is useful if you know that data is in a certain format. I use it to parse dates that are not delimited like: 060506 (often found in filenames, etc).
Anyways it seems like kind of a basic operation on strings.
It seems like there should be a more pythonic way to do this, but I can't think of one.