[IPython-user] %run foo.ipy crashes on blank lines, but %edit foo.ipy works OK

Ville M. Vainio vivainio@gmail....
Tue Jun 3 11:16:11 CDT 2008

On Tue, Jun 3, 2008 at 6:46 PM, Matthew Wilson <matt@tplus1.com> wrote:

> That is OK.  However, it seems like functions with blank lines cause a
> syntax error.  I put this function in blah.ipy:
>    def f(x):
>        "Return x squared."
>        print "x is %s." % x
>        return x * x
> Then I tried to run the file, and I got this error?

What version of ipython are you using? I think this is fixed in latest ipython.

The deal with .ipy files used to be that the file contents should be
of the kind that would be legal to enter in ipython prompt, i.e. blank
lines terminate a block. New ipython should be much smarter in this

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

More information about the IPython-user mailing list