I have got a list of strings like this:
org_list = ['', '<dialog xyz', 'string', 'more string', 'even more string etc',
'<dialog xyz', 'string', 'more string', 'even more string etc']
I need to divide the list into sublists of strings, dividing them precisely on '<' character so that every sublist of strings begins with 'dialog xyz'.
Sample output:
[['<dialog xyz', 'string', 'more string', 'even more string etc'], ['<dialog
xyz', 'string', 'more string', 'even more string etc']]
I already tried list comprehension but it does not work (returns the same org_list):
divided_list = [s.split(',') for s in ','.join(org_list).split('<')]
I know it is possible with itertools (saw it in some answers) but I am still a beginner, don't understand them much and would like to solve this with what I do understand, if possible.