title: Splitting a string into words and punctuation
body: <p>I'm trying to split a string up into words and punctuation, adding the punctuation to the list produced by the split.</p>
  
  <p>For instance:</p>
  
  <pre><code>&gt;&gt;&gt; c = "help, me"
  &gt;&gt;&gt; print c.split()
  ['help,', 'me']
  </code></pre>
  
  <p>What I really want the list to look like is:</p>
  
  <pre><code>['help', ',', 'me']
  </code></pre>
  
  <p>So, I want the string split at whitespace with the punctuation split from the words.</p>
  
  <p>I've tried to parse the string first and then run the split:</p>
  
  <pre><code>&gt;&gt;&gt; for character in c:
  ...     if character in ".,;!?":
  ...             outputCharacter = " %s" % character
  ...     else:
  ...             outputCharacter = character
  ...     separatedPunctuation += outputCharacter
  &gt;&gt;&gt; print separatedPunctuation
  help , me
  &gt;&gt;&gt; print separatedPunctuation.split()
  ['help', ',', 'me']
  </code></pre>
  
  <p>This produces the result I want, but is painfully slow on large files.</p>
  
  <p>Is there a way to do this more efficiently?</p>