title: Split a string by spaces -- preserving quoted substrings -- in Python
body: <p>I have a string which is like this:</p>
  <pre><code>this is &quot;a test&quot;
  </code></pre>
  <p>I'm trying to write something in Python to split it up by space while ignoring spaces within quotes. The result I'm looking for is:</p>
  <pre><code>['this', 'is', 'a test']
  </code></pre>
  <p>PS. I know you are going to ask &quot;what happens if there are quotes within the quotes, well, in my application, that will never happen.</p>