I want to copy already indented Python code / whole functions and classes into IPython. Everytime I try the indentation is screwed up and I get following error message:
A clarification on the steps:
First, copy target lines into your clipboard.
Type into the iPython prompt:
%paste
%cpaste
Paste (Ctrl-V) and hit enter.
Then type --
and hit enter.
For example:
In [1]: %cpaste
Pasting code; enter '--' alone on the line to stop or use Ctrl-D.
:for l in "Hello World":
: print l,
:--
H e l l o W o r l d