<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: CalculateField with PYTHON with international settings in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604383#M47245</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Use &lt;A href="http://docs.python.org/library/locale.html#locale.atof"&gt;locale.atof&lt;/A&gt;.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried already the locale option:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; gp.calculatefield(fn,'area','locale.atof(!shape.area!)','PYTHON')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gives Error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ExecuteError("ERROR 000539: Error running expression: locale.atof(7133,63322549874) &amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'int' object has no attribute 'replace'\nFailed to execute (CalculateField).\n&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 23 Apr 2011 12:15:58 GMT</pubDate>
    <dc:creator>CoDrost</dc:creator>
    <dc:date>2011-04-23T12:15:58Z</dc:date>
    <item>
      <title>CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604381#M47243</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tried to calculate an area with:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; gp.CalculateField(fcGFE_Result,'AREA','!SHAPE.AREA!','PYTHON')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I use the internation settings with a . as decimal separator everything is doing just fine.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;But my localsettings are set to ((Dutch_Netherlands)) with a "," as a decimal separator. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The error message I got is:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.CalculateField(fcGFE_Result,'AREA','!SHAPE.AREA!','PYTHON')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcgisscripting.ExecuteError: ERROR 000539: Error running expression: 304852,037832481 &amp;lt;type 'exceptions.SyntaxError'&amp;gt;: invalid token (&amp;lt;string&amp;gt;, line 1)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I using the same command within ArcMap I got no problem.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I also tried to set the locale parameters:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; locale.setlocale(locale.LC_ALL, 'C')&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;and&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; locale.setlocale(locale.LC_ALL, '')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is there anybody with a proper solution? Now I am using a workarround, but I am still curious....&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 10:32:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604381#M47243</guid>
      <dc:creator>CoDrost</dc:creator>
      <dc:date>2011-04-22T10:32:55Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604382#M47244</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use &lt;/SPAN&gt;&lt;A href="http://docs.python.org/library/locale.html#locale.atof"&gt;locale.atof&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Apr 2011 22:16:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604382#M47244</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-04-22T22:16:27Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604383#M47245</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Use &lt;A href="http://docs.python.org/library/locale.html#locale.atof"&gt;locale.atof&lt;/A&gt;.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried already the locale option:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; gp.calculatefield(fn,'area','locale.atof(!shape.area!)','PYTHON')&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;gives Error: &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; ExecuteError("ERROR 000539: Error running expression: locale.atof(7133,63322549874) &amp;lt;type 'exceptions.AttributeError'&amp;gt;: 'int' object has no attribute 'replace'\nFailed to execute (CalculateField).\n&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Apr 2011 12:15:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604383#M47245</guid>
      <dc:creator>CoDrost</dc:creator>
      <dc:date>2011-04-23T12:15:58Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604384#M47246</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;gp.calculatefield(fn,'area','locale.atof("!shape.area!")','PYTHON')&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 24 Apr 2011 04:38:55 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604384#M47246</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-04-24T04:38:55Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604385#M47247</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks, it works!!! &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Isn't it posible to disable the international settings when programming with ArcGIS in Python? It is very confusing when ArcMap functionate well with the same command and in a script you need to "locale" the geoprocessing commands...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 07:20:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604385#M47247</guid>
      <dc:creator>CoDrost</dc:creator>
      <dc:date>2011-04-26T07:20:22Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604386#M47248</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Unfortunately due to implementation details, Python doesn't see the ArcMap locale, meaning you essentially have to double-set it, once in ArcGIS and then once again in your Python script.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 20:36:46 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604386#M47248</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2011-04-26T20:36:46Z</dc:date>
    </item>
    <item>
      <title>Re: CalculateField with PYTHON with international settings</title>
      <link>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604387#M47249</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Is this double-setting being addressed in some release?&amp;nbsp; It also occurs when using SA tools necessitating that one set environments in any running tools rather than relying on defaults set elsewhere.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 26 Apr 2011 21:18:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/calculatefield-with-python-with-international/m-p/604387#M47249</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2011-04-26T21:18:59Z</dc:date>
    </item>
  </channel>
</rss>

