python: break list into pieces when an empty entry is found

Viewed 59

Lets say I have a list that looks like:

[
  [],
  ['blah','blah'],
  ['a','b'],
  [],
  ['abc','2'],
  ['ff','a'],
  ['test','a'],
  [],
  ['123','1'],
  []
]

How do I break this list into list of lists when it encounters an empty item

so list[0] would have :

['blah','blah']
['a','b']

list[1] would have:

['abc','2']
['ff','a']
['test','a']
1 Answers
Related