[IPython-dev] possible cpaste bug

Fernando Perez fperez.net at gmail.com
Mon Aug 10 22:36:18 EDT 2009


Hey John,

On Mon, Aug 10, 2009 at 4:28 PM, John Hunter<jdh2358 at gmail.com> wrote:
> but when I try and select it and paste it into ipython on OSX, I have problems
>
> I was hoping cpaste would support more than the standard paste into an
> ipython shell, eg the requirements of blank lines following indented
> regions, etc, but maybe I am pushing it too hard.  Is there some
> reason why cpaste  doesn't accept anything that "run" does?

I'm actually also seeing %cpaste problems here, no idea why:

------------------------------------------------------------
   File "<string>", line 102
     f3_CO =   [0.01, 0.01, 0.79, 0.10, 0.00, 0.05,
         ^
SyntaxError: invalid syntax


The bad news is, I don't know what the problem is.  The good news is,
there's a new %paste that will paste straight from the in-memory
clipboard, and that runs fine.  Just copy to the clipboard anything,
type 'paste' in ipython (or %paste if you have a variable called paste
already), and you're done.  It's also faster than cpaste.

%paste doesn't allow you to keep inputting text into the area like
%cpaste does, so it's not a full replacement.  But in single
copy/paste/execute cases it's actually more convenient than %cpaste,
and apparently also more robust.

If you like it, you have R. Kern to thank for :)

Cheers,

f

ps - I'm filing a bug report on this one though, even if it's tricky
to reproduce.



More information about the IPython-dev mailing list