[IPython-user] repeat multiple command

Ville Vainio vivainio at gmail.com
Fri Mar 17 18:30:53 CST 2006

On 3/17/06, John Hunter <jdhunter at ace.bsd.uchicago.edu> wrote:

> and realize, oops, I forgot to define "big".  So the I want to do
> In [37]: big = []
> and then rerun all the lines from In[36] .
> Magic incantation?

The svn version supports:


If there was multiple lines something like


would also work.

[ipython]|33> _ip.runlines?
Type:           instancemethod
Base Class:     <type 'instancemethod'>
String Form:    <bound method IPApi.runlines of <IPython.ipapi.IPApi instance at
Namespace:      Python builtin
File:           f:\prj\ipython\ipython\ipapi.py
Definition:     _ip.runlines(self, lines)
    Run the specified lines in interpreter, honoring ipython directives.

This allows %magic and !shell escape notations.

Takes either all lines in one string or list of lines.

Ville Vainio - vivainio.googlepages.com
vainio.blogspot.com - g[mail | talk]='vivainio'

More information about the IPython-user mailing list