[IPython-dev] pasting lines with "\" into ipython

Gökhan SEVER gokhansever at gmail.com
Fri May 22 10:36:34 EDT 2009


Hi Ondrej,

I don't know the exact answer, however if you put the comma after back-slash
on a new line it works.

In [10]: from hermes2d import Mesh, H1Shapeset, PrecalcShapeset, H1Space \
   ....: ,WeakForm, Solution, ScalarView, LinSystem, DummySolver

and IPython complains about a missing module as expected other than a syntax
error :)


Gökhan


On Thu, May 21, 2009 at 9:15 PM, Ondrej Certik <ondrej at certik.cz> wrote:

> Hi,
>
> and I want to copy & paste the code at the front page:
>
> http://code.google.com/p/femhub/
>
> into ipython. The problematic lines are:
>
> from hermes2d import Mesh, H1Shapeset, PrecalcShapeset, H1Space, \
>       WeakForm, Solution, ScalarView, LinSystem, DummySolver
> from hermes2d.forms import set_forms
> from hermes2d.examples import get_example_mesh
>
> if I paste the first line, this is what happens:
>
>
> In [2]: from hermes2d import Mesh, H1Shapeset, PrecalcShapeset, H1Space, \
> ------------------------------------------------------------
>   File "<ipython console>", line 1
> SyntaxError: trailing comma not allowed without surrounding
> parentheses (<ipython console>, line 1)
>
>
> and then the rest of lines fail too. If I fix this, e.g. write it
> without "\", for example by concatenating the lines, then the whole
> script can be just copy & pasted and it rocks.
>
>
> Is there some reason why the line with "\" doesn't work?
>
> Ondrej
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://mail.scipy.org/mailman/listinfo/ipython-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20090522/fff366a4/attachment.html>


More information about the IPython-dev mailing list