This is a read only copy of the old FEniCS QA forum. Please visit the new QA forum to ask questions

Python/Spyder Syntax error

0 votes

Hallo,

while running the ft01_poisson.py example on spyder, I get the following error:

"....

runfile('/home/mosdef/Schreibtisch/ft01_poisson.py', wdir='/home/mosdef/Schreibtisch')
File "/home/mosdef/Schreibtisch/ft01_poisson.py", line 11
V = FunctionSpace(mesh, ’P’, 1)
^
SyntaxError: invalid syntax
...."

Does anyone know what the problem is?

asked Apr 25, 2017 by Mosdef1919 FEniCS Novice (150 points)

1 Answer

0 votes
 
Best answer

The quotes you use in ’P’ is not valid Python syntax. Use either 'P' or "P".

answered Apr 26, 2017 by johannr FEniCS Expert (17,350 points)
selected Apr 27, 2017 by Mosdef1919

Thanks Johannr.

That helped me a lot.

Appreciated.

...