13

I used IPython in the past and I used to be able to copy and paste multi-line commands, e.g., a for loop in IPython. Working in my new PC after installing Python(x,y) 2.7.2.1, I can paste multi-line snippets by using Right-click → Edit → Paste but not by using CTRL+P, as I used to do. When using CTRL+P only the first line for the multi-line snippet gets pasted. Can somebody help please? I looked in the settings and documentation to no avail.

Anthony Geoghegan
  • 11,533
  • 5
  • 49
  • 56
RandomCPlusPlus
  • 359
  • 1
  • 5
  • 12

2 Answers2

25

Type %paste into the IPython command line.

A. Jesse Jiryu Davis
  • 23,641
  • 4
  • 57
  • 70
17

You can use %cpaste with IPython shell (which is also what is used by Django's management shell). If you want to learn more of the features, type %quickref.

Ben
  • 1,620
  • 18
  • 11