Select to view content in your preferred language

PyScripter moving syntax error

3021
2
Jump to solution
01-13-2013 11:33 PM
by Anonymous User
Not applicable
Original User: M.Engelsma

Hello all,
while building a script to run a custom model in PyScripter I'm running into a problem regarding syntax errors.

At a certain moment a syntax error popped up (in this case in line 72 as visible in the picture below) in a line
that is identical to some previous lines. The only difference is in the text that is to be displayed. Only the
arcpy. part is marked as an error though.
[ATTACH=CONFIG]20685[/ATTACH]

In itself this error is frustrating but the weird thing is that when I comment out this line the error jumps to
the next line of code. This continues to happen no matter how many lines I comment out. In the picture below the
error jumped to line 76.
[ATTACH=CONFIG]20686[/ATTACH]

The problem isn't just in PyScripter  since when I try to run the tool that uses this script it also gives a
syntax error in the same line.

I'm using ArcGis 10.0 and PyScripter v2.5.3 for registry free installation. Unfortunately I can't test this on the
registered version of PyScripter since that would require a lengthy discussion with our ICT department.

Has anyone encountered this before and is there a way to fix this or found a workaround?

Below I copied part of the code that gives the syntax error.
arcpy.AddMessage ("Contour van de peiling maken")  PRas = r"S:\GEOINFO\05_Tekenkamer\Marc\Werkdatabase.gdb\xxxOutput_peiling_raster" PRas_Int = r"S:\GEOINFO\05_Tekenkamer\Marc\Werkdatabase.gdb\xxxOutput_peiling_raster_Int" OutPol = r"S:\GEOINFO\05_Tekenkamer\Marc\Werkdatabase.gdb\Peilingen_ed\xxxOutput_peiling_Polygon"  arcpy.AddMessage ("Punten omzetten naar tijdelijk rasterbestand") arcpy.PointToRaster_conversion (Output_Punten,"Z", PRas, "MEAN", "NONE", str(Resolution)  arcpy.AddMessage ("Punten omzetten naar tijdelijk rasterbestand") arcpy.gp.Int_sa(PRas, PRas_Int)  arcpy.AddMessage ("Rasterbestand omzetten naar polygon") arcpy.RasterToPolygon_conversion(PRas_Int, OutPol )  arcpy.AddMessage ("Polygon dissolven naar buitenste contour") arcpy.Dissolve_management (OutPol, Output_Contour)
0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable
Original User: arekmatoszka

Hi,
There is missing right parenthesis in line just above hilighted error, that's why commenting line moves error to next line:

arcpy.PointToRaster_conversion (Output_Punten,"Z", PRas, "MEAN", "NONE", str(Resolution))


Cheers
Arek

View solution in original post

0 Kudos
2 Replies
by Anonymous User
Not applicable
Original User: arekmatoszka

Hi,
There is missing right parenthesis in line just above hilighted error, that's why commenting line moves error to next line:

arcpy.PointToRaster_conversion (Output_Punten,"Z", PRas, "MEAN", "NONE", str(Resolution))


Cheers
Arek
0 Kudos
MarcEngelsma1
Deactivated User
Hi Arek,
Thanks a lot, that solved it indeed.
I was focusing too much on the line where the error showed so thank you for pointing me to the previous line.

Cheers,
Marc
0 Kudos