Is there a way to take a string that is 4*x characters long, and cut it into 4 strings, each x characters long, without knowing the length of the s
4*x
x
def split2len(s, n): def _f(s, n): while s: yield s[:n] s = s[n:] return list(_f(s, n))