xxxxxxxxxx
sentence = 'This is a sentence'
split_value = []
tmp = ''
for c in sentence:
if c == ' ':
split_value.append(tmp)
tmp = ''
else:
tmp += c
if tmp:
split_value.append(tmp)
great answer!
xxxxxxxxxx
>>> import ast
>>> list_as_string = "['item 1', 'item 2', 'item 3']"
>>> _list = ast.literal_eval(list_as_string)
>>> _list
['item 1', 'item 2', 'item 3']
>>>