Try using a list
comprehension:
text = "this is line one . this is line two . this is line three ."
print([line.rstrip().split() for line in text.split('.') if line])
Output:
[['this', 'is', 'line', 'one'], ['this', 'is', 'line', 'two'], ['this', 'is', 'line', 'three']]
If you want to keep the splitters try:
import re
text = "this is line one . this is line two . this is line three ."
print([line.rstrip().split() for line in re.split('([^.]*.)', text) if line])
Output:
[['this', 'is', 'line', 'one', '.'], ['this', 'is', 'line', 'two', '.'], ['this', 'is', 'line', 'three', '.']]
Edit:
If you want to do list split try:
l = ['this', 'is', 'line', 'one', '.', 'this', 'is', 'line', 'two', '.', 'this', 'is', 'line', 'three', '.']
newl = [[]]
for i in l:
newl[-1].append(i)
if i == '.':
newl.append([])
print(newl)
Output:
[['this', 'is', 'line', 'one', '.'], ['this', 'is', 'line', 'two', '.'], ['this', 'is', 'line', 'three', '.'], []]