<?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 Help with Python Scripting in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324885#M25264</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a database with two tables populated with at least 10,000 records each. I have set up new subtyped fields and want to fill them. However, the editing process is very slow with the amount of data that I have. Is there a way to write a python program that automates the editing process?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 20 Mar 2012 14:18:12 GMT</pubDate>
    <dc:creator>NoraAllen</dc:creator>
    <dc:date>2012-03-20T14:18:12Z</dc:date>
    <item>
      <title>Help with Python Scripting</title>
      <link>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324885#M25264</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I have a database with two tables populated with at least 10,000 records each. I have set up new subtyped fields and want to fill them. However, the editing process is very slow with the amount of data that I have. Is there a way to write a python program that automates the editing process?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 14:18:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324885#M25264</guid>
      <dc:creator>NoraAllen</dc:creator>
      <dc:date>2012-03-20T14:18:12Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Python Scripting</title>
      <link>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324886#M25265</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Very likely, yes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. Try giving more information.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 20 Mar 2012 14:25:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324886#M25265</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-03-20T14:25:04Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Python Scripting</title>
      <link>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324887#M25266</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am relatively new at scripting, but what I came up with is this:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cur = arcpy.UpdateCursor(FC)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;for row in cur:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldVal = row.getValue(fieldOne)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fieldVal = xxxxxxx:&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value =&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(newField, value)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I feel like I am on the right track, but I have no idea how to utilize an existing subtype. How do you bring subtypes into a python program?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 21 Mar 2012 23:55:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324887#M25266</guid>
      <dc:creator>NoraAllen</dc:creator>
      <dc:date>2012-03-21T23:55:42Z</dc:date>
    </item>
    <item>
      <title>Re: Help with Python Scripting</title>
      <link>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324888#M25267</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;First things first... read &lt;/SPAN&gt;&lt;A href="http://forums.arcgis.com/threads/48475-Please-read-How-to-post-Python-code" rel="nofollow noopener noreferrer" target="_blank"&gt;thisthread&lt;/A&gt;&lt;SPAN&gt; and put code tags around your script.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Like so:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cur = arcpy.UpdateCursor(FC)
for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldVal = row.getValue(fieldOne)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fieldVal = xxxxxxx:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value =
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; row.setValue(newField, value)&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;A few issues:&lt;/SPAN&gt;&lt;BR /&gt;&lt;UL&gt;&lt;BR /&gt;&lt;LI&gt;a try: statement must have an except: clause&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;equality tests use "==" not "="&lt;/LI&gt;&lt;BR /&gt;&lt;LI&gt;"value =" needs a value or it will cause a syntax error, i.e. value = "something"&lt;/LI&gt;&lt;BR /&gt;&lt;/UL&gt;&lt;SPAN&gt;E.g.&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;cur = arcpy.UpdateCursor(FC)
for row in cur:
&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; fieldVal = row.getValue(fieldOne)
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if fieldVal == xxxxxxx:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; value = row.setValue(newField, value)
&amp;nbsp;&amp;nbsp;&amp;nbsp; except Exception as err:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Do something useful here or don't use try except at all&lt;/PRE&gt;&lt;BR /&gt;&lt;SPAN&gt;For any more assistance you need to give us more info - are you calculating for each of the 2 tables separately, are they joined, do you have to get the value for "newField" from another field in the table/s, etc...?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 15:24:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/help-with-python-scripting/m-p/324888#M25267</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2021-12-11T15:24:21Z</dc:date>
    </item>
  </channel>
</rss>

