title: How to Copy from IPython session without terminal prompts
body: <p>Frequently, my workflow involves data cleaning/munging in an IPython shell. This has become particularly wonderful since IPython version 5.0 with all the great <a href="http://ipython.readthedocs.io/en/stable/whatsnew/version5.html#new-terminal-interface" rel="noreferrer">upgrades to the terminal interface</a>. So, let's say I make an attempt at sprucing up some piece of unstructured data:</p>
  
  <pre><code>In [11]: for i, (num, header, txt) in enumerate(data):
      ...:     header = [e.strip() for e in header.strip().split('\n')]
      ...:     header[4] = header[4].strip(',').split(',')
      ...:     data[i] = (num, header, txt)
      ...:
  </code></pre>
  
  <p>Fantastic, it works! But now, I would really like to add this to a script in my editor. If I copy and paste from my terminal, I capture all the junk on the left. I can clean this up more-or-less easily in an editor, but it would be great if I could copy the code directly to my clipboard from the terminal without touching the mouse and without grabbing the extra stuff either. Is there such a functionality in IPython?</p>