cdrost

CalculateField with PYTHON with international settings

Discussion created by cdrost on Apr 22, 2011
Latest reply on Apr 23, 2011 by cdrost
I tried to calculate an area with:

  gp.CalculateField(fcGFE_Result,'AREA','!SHAPE.AREA!','PYTHON')

When I use the internation settings with a . as decimal separator everything is doing just fine.
But my localsettings are set to ((Dutch_Netherlands)) with a "," as a decimal separator.

The error message I got is:
    gp.CalculateField(fcGFE_Result,'AREA','!SHAPE.AREA!','PYTHON')
arcgisscripting.ExecuteError: ERROR 000539: Error running expression: 304852,037832481 <type 'exceptions.SyntaxError'>: invalid token (<string>, line 1)

When I using the same command within ArcMap I got no problem.

I also tried to set the locale parameters:
  locale.setlocale(locale.LC_ALL, 'C')
and
locale.setlocale(locale.LC_ALL, '')

Is there anybody with a proper solution? Now I am using a workarround, but I am still curious....

Outcomes