In ipython >=0.11, the %paste command is required to paste indented commands. However, if I run an ipython shell in a remote terminal, the buffer %paste refers to is on the remote machine rather than the local machine. Is there any way around this?
In ipython >=0.11, the %paste command is required to paste indented commands. However, if
Share
I think this is exactly what
%cpasteis for (I am always forgetting about all the things IPython does).%cpasteenters a state allowing you to paste already formatted or indented code, and it will strip leading indentation and prompts, so you can copy/paste indented code from files, or even from an interactive Python session including leading>>>orIn [1]which will be stripped.