<p>Is there a function in Python to split a string without ignoring the spaces in the resulting list? </p>

<p>E.g:</p>

<pre><code>s="This is the string I want to split".split()
</code></pre>

<p>gives me</p>

<pre><code>&gt;&gt;&gt; s
['This', 'is', 'the', 'string', 'I', 'want', 'to', 'split']
</code></pre>

<p>I want something like</p>

<pre><code>['This',' ','is',' ', 'the',' ','string', ' ', .....]
</code></pre>

The hard part with what you're trying to do is that you aren't giving it a character to split on. split() explodes a string on the character you provide to it, and removes that character.
Perhaps this may help:
```
```
s = "String to split"
mylist = []
for item in s.split():
    mylist.append(item)
    mylist.append(' ')
mylist = mylist[:-1]
```
```
Messy, but it'll do the trick for you...