In iPython:
~ $ ipython
Python 2.7.10 (default, Oct 23 2015, 19:19:21)
Type "copyright", "credits" or "license" for more information.
IPython 2.3.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]:
Assign what you're about to paste to variabe currToParse
, paste from clipboard, end the %cpaste
"session" with --
and hit enter to finish assigning to the variable:
In [90]: %cpaste currToParse
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:
{ugly multiline code you paste from clipboard}
:--
Block assigned to 'currToParse'
Join into a single string:
In [91]: currToParse = "\n".join(currToParse)
No we can manipulate this monstrosity of ugly multiline HTML code etc. from inside the iPython interpreter