<?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 my code fails with &amp;amp;amp;quot;geoprocessing object not iterable&amp;amp;amp;quot; in 9.3 but works in 10 in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461688#M36121</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone explain why my code fails with "geoprocessing object not iterable" in 9.3 but works in 10. Are there some compatibility issues going on? I wrote the python code in 10 but made sure not to make any calls to arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I invoked, gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My understanding is before 9.3, python didn't use 'real' lists, so calling list methods would obviously fail. Is that wrong? Is 9.3 not able to use list methods?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code, I believe, is where the problem is...I think??&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# function to return appropriate 3.0 feature class for given 2.6 feature class # and it returns the name of the fieldname, FC_26_name def which30(two6ftrcls):&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; two6FC = two6ftrcls &amp;nbsp;&amp;nbsp;&amp;nbsp; whereclause = "Two6FCs = '" + two6FC + "'" &amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("whereclause is " +whereclause) &amp;nbsp;&amp;nbsp;&amp;nbsp; crosswalk = ShellPath + "/Two630FC_IDPKxwalk.dbf" &amp;nbsp;&amp;nbsp;&amp;nbsp; # The variables row and rows are initially set to None, so that they &amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; can be deleted in the finally block regardless of where (or if) &amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; script fails. &amp;nbsp;&amp;nbsp;&amp;nbsp; row, rows = None, None &amp;nbsp;&amp;nbsp;&amp;nbsp; Three0ftrlst = [] &amp;nbsp;&amp;nbsp;&amp;nbsp; FC_26namelst = [] &amp;nbsp;&amp;nbsp;&amp;nbsp; rows = gp.SearchCursor(crosswalk,whereclause) &amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next() &amp;nbsp;&amp;nbsp;&amp;nbsp; if (row == None): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("check the Two630FC_IDPKxwalk.dbf table for Two6FCs --&amp;gt;" +two6FC) &amp;nbsp;&amp;nbsp;&amp;nbsp; elif (row != None): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = gp.SearchCursor(crosswalk,whereclause) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not row.isNull("Three0FCs"): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Three0ftr=row.getValue("Three0FCs") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Three0ftrlst.append(str(Three0ftr)) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FC_26name = row.getValue("FC_26") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FC_26namelst.append(str(FC_26name))&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if row: del row &amp;nbsp;&amp;nbsp;&amp;nbsp; if rows: del rows&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return Three0ftrlst, FC_26namelst&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 22 Jun 2012 06:10:45 GMT</pubDate>
    <dc:creator>kyleturner</dc:creator>
    <dc:date>2012-06-22T06:10:45Z</dc:date>
    <item>
      <title>my code fails with &amp;amp;quot;geoprocessing object not iterable&amp;amp;quot; in 9.3 but works in 10</title>
      <link>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461688#M36121</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can anyone explain why my code fails with "geoprocessing object not iterable" in 9.3 but works in 10. Are there some compatibility issues going on? I wrote the python code in 10 but made sure not to make any calls to arcpy.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I invoked, gp = arcgisscripting.create(9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;My understanding is before 9.3, python didn't use 'real' lists, so calling list methods would obviously fail. Is that wrong? Is 9.3 not able to use list methods?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The following code, I believe, is where the problem is...I think??&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;# function to return appropriate 3.0 feature class for given 2.6 feature class # and it returns the name of the fieldname, FC_26_name def which30(two6ftrcls):&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; two6FC = two6ftrcls &amp;nbsp;&amp;nbsp;&amp;nbsp; whereclause = "Two6FCs = '" + two6FC + "'" &amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("whereclause is " +whereclause) &amp;nbsp;&amp;nbsp;&amp;nbsp; crosswalk = ShellPath + "/Two630FC_IDPKxwalk.dbf" &amp;nbsp;&amp;nbsp;&amp;nbsp; # The variables row and rows are initially set to None, so that they &amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; can be deleted in the finally block regardless of where (or if) &amp;nbsp;&amp;nbsp;&amp;nbsp; #&amp;nbsp; script fails. &amp;nbsp;&amp;nbsp;&amp;nbsp; row, rows = None, None &amp;nbsp;&amp;nbsp;&amp;nbsp; Three0ftrlst = [] &amp;nbsp;&amp;nbsp;&amp;nbsp; FC_26namelst = [] &amp;nbsp;&amp;nbsp;&amp;nbsp; rows = gp.SearchCursor(crosswalk,whereclause) &amp;nbsp;&amp;nbsp;&amp;nbsp; row = rows.next() &amp;nbsp;&amp;nbsp;&amp;nbsp; if (row == None): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; gp.AddMessage("check the Two630FC_IDPKxwalk.dbf table for Two6FCs --&amp;gt;" +two6FC) &amp;nbsp;&amp;nbsp;&amp;nbsp; elif (row != None): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; rows = gp.SearchCursor(crosswalk,whereclause) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for row in rows: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not row.isNull("Three0FCs"): &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Three0ftr=row.getValue("Three0FCs") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Three0ftrlst.append(str(Three0ftr)) &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FC_26name = row.getValue("FC_26") &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FC_26namelst.append(str(FC_26name))&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; if row: del row &amp;nbsp;&amp;nbsp;&amp;nbsp; if rows: del rows&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; return Three0ftrlst, FC_26namelst&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 06:10:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461688#M36121</guid>
      <dc:creator>kyleturner</dc:creator>
      <dc:date>2012-06-22T06:10:45Z</dc:date>
    </item>
    <item>
      <title>Re: my code fails with "geoprocessing object not iterable" in 9.3 but works in 10</title>
      <link>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461689#M36122</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;The difference is in the 9.3 and 10 cursor objects.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;The difference manifests itself in the application version, not in the geoprocessor version&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(that is, a 9.3 geoprocessor cursor created in 10 uses the 10 behavior, &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;while the same code (with a 9.3 geoprocessor cursor) that will run in 10 will not run in 9.3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(...and vice-versa)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In 10, one iterates the cursor:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;for theRow in theCursor: &amp;nbsp;&amp;nbsp;&amp;nbsp; pass&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;SPAN&gt;in 9, one steps the cursor manually because the cursor cannot be iterated:&lt;/SPAN&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;theRow = theCursor.next() while theRow: &amp;nbsp;&amp;nbsp;&amp;nbsp; pass &amp;nbsp;&amp;nbsp;&amp;nbsp; theRow = theCursor.next()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Even in 10, one manually steps an InsertCursor (for obvious reasons)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is a real pain when having to write code that works in both versions &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;(don't ask, but I hope to be clear of 9.3 soon)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Actually, I rather liked the 9.3 behavior. One could easily run multiple simultaneous cursors in parallel.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes, there are other ways to do it, but I liked having the option.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 11:15:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461689#M36122</guid>
      <dc:creator>markdenil</dc:creator>
      <dc:date>2012-06-22T11:15:12Z</dc:date>
    </item>
    <item>
      <title>Re: my code fails with "geoprocessing object not iterable" in 9.3 but works in 10</title>
      <link>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461690#M36123</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Mark,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Wow...I'm glad I got someone with your knowledge to respond.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;So, how do I write it to be used in both versions.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Incidentally, the only reason my code calls rows.next() is because early on in the development I was checking if rows was == None, which it never is because it always returns an object. So, I had to advance to a row to see if the row was == None.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you follow? (Also, have you figured out that I barely know what I'm doing....probably.)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Again, any help is greatly appreciated.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Feel free to email me at: &lt;/SPAN&gt;&lt;A href="mailto:turnerkyle@hotmail.com"&gt;turnerkyle@hotmail.com&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 22 Jun 2012 12:38:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/my-code-fails-with-amp-amp-quot-geoprocessing/m-p/461690#M36123</guid>
      <dc:creator>kyleturner</dc:creator>
      <dc:date>2012-06-22T12:38:27Z</dc:date>
    </item>
  </channel>
</rss>

