<?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: I am new to Python. I am trying to write a script that will populate one field based on the contents of another field. in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332343#M25885</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;formatting issues...not checking logic issues&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14096794568466072 jive_text_macro" jivemacro_uid="_14096794568466072" modifiedtitle="true"&gt;
&lt;P&gt;def calc(f1):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if f1 == "A-10":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = "Agricultural 10 Acres"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; elif f1 == "something else":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = "not"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = "still not"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return a&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or in the field calculator (untested)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;"Agricultural 10 Acres" if !Zone! == "A-10" else "False"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 02 Sep 2014 17:40:42 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2014-09-02T17:40:42Z</dc:date>
    <item>
      <title>I am new to Python. I am trying to write a script that will populate one field based on the contents of another field.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332340#M25882</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I want the ZONE_DESC unit to be Agricultural 10 Acres if the ZONE unit is A-10. This is just the first part of the script. Later I will add if, elseif, and then statements to complete the script to assign the rest of the units of the ZONE_DESC field. when I run this portion of the script I get error messages. Am I close or I am way off?&lt;/P&gt;&lt;P&gt;&lt;IMG alt="Python.PNG" class="jive-image image-1" src="https://community.esri.com/legacyfs/online/7066_Python.PNG" style="width: 620px; height: 427px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 17:24:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332340#M25882</guid>
      <dc:creator>BrianHadley</dc:creator>
      <dc:date>2014-09-02T17:24:36Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Python. I am trying to write a script that will populate one field based on the contents of another field.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332341#M25883</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;try using a double equals:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;f1 == "A-10"&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;a single = sign means you are trying to assign that value to the variable &lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 17:29:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332341#M25883</guid>
      <dc:creator>AnthonyGiles</dc:creator>
      <dc:date>2014-09-02T17:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Python. I am trying to write a script that will populate one field based on the contents of another field.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332342#M25884</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Your image shows that the parser is set to VB Script, which means it is expecting to read VB Script. Since you've written Python, change the parser to Python.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Also, you need to indent everything under the def statement.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 17:29:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332342#M25884</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2014-09-02T17:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: I am new to Python. I am trying to write a script that will populate one field based on the contents of another field.</title>
      <link>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332343#M25885</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;formatting issues...not checking logic issues&lt;/P&gt;&lt;PRE __default_attr="python" __jive_macro_name="code" class="jive_macro_code _jivemacro_uid_14096794568466072 jive_text_macro" jivemacro_uid="_14096794568466072" modifiedtitle="true"&gt;
&lt;P&gt;def calc(f1):&lt;/P&gt;
&lt;P&gt;&amp;nbsp; if f1 == "A-10":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = "Agricultural 10 Acres"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; elif f1 == "something else":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = "not"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; else:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; a = "still not"&lt;/P&gt;
&lt;P&gt;&amp;nbsp; return a&lt;/P&gt;
&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp; &lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;or in the field calculator (untested)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="font-family: courier new,courier;"&gt;"Agricultural 10 Acres" if !Zone! == "A-10" else "False"&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 02 Sep 2014 17:40:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/i-am-new-to-python-i-am-trying-to-write-a-script/m-p/332343#M25885</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2014-09-02T17:40:42Z</dc:date>
    </item>
  </channel>
</rss>

