<?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 Newbie: Why wouldn't this simple code work? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209800#M16234</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Purpose:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 1 field in a large table with numbers in mm, want to show in m. Want to use python to multiply by 1000. Want to use the Python Field Calculator for this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def func( height ):&amp;nbsp; return (height*1000)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;HEIGHT_MM= func(!HEIGHT_MM)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the code succeeds (no syntax errors), but nothing happens to the numbers in my field!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 10 Apr 2012 18:10:42 GMT</pubDate>
    <dc:creator>PeterPeng</dc:creator>
    <dc:date>2012-04-10T18:10:42Z</dc:date>
    <item>
      <title>Newbie: Why wouldn't this simple code work?</title>
      <link>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209800#M16234</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Purpose:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have 1 field in a large table with numbers in mm, want to show in m. Want to use python to multiply by 1000. Want to use the Python Field Calculator for this.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;def func( height ):&amp;nbsp; return (height*1000)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;HEIGHT_MM= func(!HEIGHT_MM)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Result:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;the code succeeds (no syntax errors), but nothing happens to the numbers in my field!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 18:10:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209800#M16234</guid>
      <dc:creator>PeterPeng</dc:creator>
      <dc:date>2012-04-10T18:10:42Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie: Why wouldn't this simple code work?</title>
      <link>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209801#M16235</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You need another exclamation mark around the field name. I'm a little bit surprised that it ran at all. It may be interpretting the one exclamation as "if HEIGHT_MM does not exist".&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;HEIGHT_MM= func(!HEIGHT_MM!)&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 18:14:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209801#M16235</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2012-04-10T18:14:11Z</dc:date>
    </item>
    <item>
      <title>Re: Newbie: Why wouldn't this simple code work?</title>
      <link>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209802#M16236</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;It should be:&lt;/SPAN&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;HEIGHT_MM= func(!HEIGHT_MM!)&lt;/PRE&gt;&lt;SPAN&gt;You're missing the trailing exclamation.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 10 Apr 2012 18:14:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/newbie-why-wouldn-t-this-simple-code-work/m-p/209802#M16236</guid>
      <dc:creator>BruceNielsen</dc:creator>
      <dc:date>2012-04-10T18:14:12Z</dc:date>
    </item>
  </channel>
</rss>

