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

Ondrej Certik ondrej@certik...
Thu May 21 21:15:03 CDT 2009


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


More information about the IPython-dev mailing list