Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Paste Multi-line Snippets into IPython

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.

like image 423
RandomCPlusPlus Avatar asked Apr 19 '12 14:04

RandomCPlusPlus


People also ask

How do I type multiple lines in IPython?

Ctrl+o. If you type Ctrl+o, you should be able to add additional lines to the input to run them simultaneously. If that doesn't work, as a workaround, you can paste multiple lines after copying them from elsewhere, or you can press enter on a line with a semicolon or unclosed parentheses.

How do you paste into IPython?

To copy text, just select it and hit Ctrl-C (Command-C on a Mac). If the highlight marking the selection disappears, that's normal and it means it's worked. To paste, use Ctrl-V (Command-V on a Mac).


1 Answers

Type %paste into the IPython command line.

like image 62
A. Jesse Jiryu Davis Avatar answered Oct 26 '22 01:10

A. Jesse Jiryu Davis