>>> [list(x[1]) for x in itertools.groupby(['|', u'MOM', u'DAD', '|', u'GRAND', '|', u'MOM', u'MAX', u'JULES', '|'], lambda x: x=='|') if not x[0]]
[[u'MOM', u'DAD'], [u'GRAND'], [u'MOM', u'MAX', u'JULES']]
More Related Contents:
- How to split pipe-separated string into a list? [duplicate]
- How do you split a list into evenly sized chunks?
- How can I split a text into sentences?
- Split string on whitespace in Python [duplicate]
- How to split a string of space separated numbers into integers?
- How to split text without spaces into list of words
- Why are empty strings returned in split() results?
- Splitting a semicolon-separated string to a dictionary, in Python
- sscanf in Python
- How do I split a string into a list?
- python split a string with at least 2 whitespaces
- Quickest way to make a get_dummies type dataframe from a column with a multiple of strings
- Split a string only by first space in python
- Split string on commas but ignore commas within double-quotes?
- How to split strings inside a list by whitespace characters
- How would I get everything before a : in a string Python
- How to Split Image Into Multiple Pieces in Python
- Attribute Error: ‘list’ object has no attribute ‘split’
- Python regex: splitting on pattern match that is an empty string
- How can I split a string of a mathematical expressions in python?
- How to split a string by commas positioned outside of parenthesis?
- Split string at nth occurrence of a given character
- Python: Split NumPy array based on values in the array
- Why does str.split not take keyword arguments?
- Split strings in tuples into columns, in Pandas
- How can i parse a comma delimited string into a list (caveat)?
- Python split string in moving window
- Splitting a math expression string into tokens in Python
- Extract first item of each sublist in Python
- Split pandas dataframe in two if it has more than 10 rows