def chunked_list ( _list , _chunk_size = 50 ) : for i in range ( 0 , len ( _list ) , _chunk_size ) : yield _list [ i : i + _chunk_size ]
fasting way to loop over a large list in python
Break lists into small lists for processing : w
def chunked_list(_list, _chunk_size=50):
    """
    Break lists into small lists for processing:w
    """
    for i in range(0, len(_list), _chunk_size):
        yield _list[i:i + _chunk_size]