[IPython-user] paste from clipboard as numpy array

Jörgen Stenarson jorgen.stenarson@bostream...
Wed Jan 27 11:28:14 CST 2010


Pavlo Shchelokovskyy skrev 2010-01-27 15:32:
> Hi all users and developers of IPython,
> I'm actively using ipython, and I simply love it, but there is one
> problem I am experiencing.
>
> I would like to have possibility to copy some data as tab-separated
> multi-line text and paste it directly into ipython as (2D) numpy
> array. Although PyReadline's intro says it can "Smart paste for
> convenient use with ipython. Converting tab separated data to python
> list or numpy array", I never worked for me that way.

Hi,

I guess the instructions are not complete. You need to bind a key to 
ipython_paste in your pyreadline_config.ini.

Example:
bind_key("Control-v", "ipython_paste")

should replace the regular paste with the "smart" paste.

/Jörgen


More information about the IPython-user mailing list