def partition_horizontal_twice(thelist, numbers):
    """
    numbers is split on a comma to n and n2.
    Break a list into peices each peice alternating between n and n2 items long 
    ``partition_horizontal_twice(range(14), "3,4")`` gives::
    
        [[0, 1, 2],
         [3, 4, 5, 6], 
         [7, 8, 9], 
         [10, 11, 12, 13]]
    
    Clear as mud?
    """
    n, n2 = numbers.split(',')
    try:
        n = int(n)
        n2 = int(n2)
        thelist = list(thelist)
    except (ValueError, TypeError):
        return [thelist]
    newlists = []
    while thelist:
        newlists.append(thelist[:n])
        thelist = thelist[n:]
        newlists.append(thelist[:n2])
        thelist = thelist[n2:]
    return newlists
def partition_horizontal_twice ( thelist , numbers ) : n , n2 = numbers . split ( ',' ) try : n = int ( n ) n2 = int ( n2 ) thelist = list ( thelist ) except ( ValueError , TypeError ) : return [ thelist ] newlists = [ ] while thelist : newlists . append ( thelist [ : n ] ) thelist = thelist [ n : ] newlists . append ( thelist [ : n2 ] ) thelist = thelist [ n2 : ] return newlists
numbers is split on a comma to n and n2.
    Break a list into peices each peice alternating between n and n2 items long 
    ``partition_horizontal_twice(range(14), "3,4")`` gives::
    
        [[0, 1, 2],
         [3, 4, 5, 6], 
         [7, 8, 9], 
         [10, 11, 12, 13]]
    
    Clear as mud?