using regex
and itertools.chain()
:
In [91]: my_lis=[[1,2,2,1], [0,0,1,2], [1,2,0,0], [1,0,0,10]]
In [92]: my_lis1=[[y.split() for y in filter(None,re.split(r"\b\s?0\s?\b",
" ".join(map(str,x))))] for x in my_lis]
In [93]: [map(int,chain(*x)) for x in my_lis1]
Out[93]: [[1, 2, 2, 1], [1, 2], [1, 2], [1, 10]]