[IPython-dev] [IPython-user] New feature: %run myscript.ipy

Ville M. Vainio vivainio at gmail.com
Wed Dec 13 01:52:16 EST 2006

On 12/13/06, Brian Granger <ellisonbg.net at gmail.com> wrote:

> How is this done?  As I remember, the normal %run basically does an
> exec on the file as a whole.  By that I mean that the file is parsed
> as a whole before being run.  But IPython commands are not able to be
> run in this fashion.  This has come up in the version of run that is
> in ipython1 that works remotely.  In that case we just pass the file
> line by line to the interactive interpreter rather than doing an exec
> on the whole file.  The difficulty is that there are a bunch of funny
> things that you have to watch out for - like you need more than one
> space after an indented code block.  Does the new %run have this
> restriction for ipy files?  I almost think it should be called
> something different because the behavior is different.  Fernando?

Yes, the .ipy file running is a whole different beast, see


I think %run is a 'logical' place to do this, in that the user does
think that "he's running an .ipy script", i.e. %run is easy to
remember. The docstring is explicit about the difference (see the trac

Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'

More information about the IPython-dev mailing list