<?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: simple da.SearchCursor error in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546048#M42575</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HA HA HA HA!&amp;nbsp; I knew I was getting the weekend glazed eyes!&amp;nbsp; thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 19 Jul 2012 19:21:24 GMT</pubDate>
    <dc:creator>KevinBell</dc:creator>
    <dc:date>2012-07-19T19:21:24Z</dc:date>
    <item>
      <title>simple da.SearchCursor error</title>
      <link>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546046#M42573</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Ok, I've got other da.SearchCursors that work just fine.&amp;nbsp; What up with this one???!&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; d = {} tbl = r'E:\gis\forestry\20120711_forestryWebApp\temp.gdb\wholeCity' with arcpy.da.SearchCursor('tbl', ['rangeClass', 'count']) as c: &amp;nbsp;&amp;nbsp;&amp;nbsp; for r in c:&amp;nbsp; print r[0], r[1]&amp;nbsp; #d[r[0]] = r[1]&amp;nbsp;&amp;nbsp; print d&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Running this i get:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;RuntimeError: cannot open 'tbl'&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;File "C:\temp\temp.py", line 5, in &amp;lt;module&amp;gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; with arcpy.da.SearchCursor('tbl', ['rangeClass', 'count']) as c:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it just that I want to jump on my moto and start riding to San Diego?!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 17:53:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546046#M42573</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2012-07-19T17:53:01Z</dc:date>
    </item>
    <item>
      <title>Re: simple da.SearchCursor error</title>
      <link>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546047#M42574</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Kevin,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;You have tbl declared as a variable, and then you declare it as a string with the SearchCursor.&amp;nbsp; Try the following:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;import arcpy&amp;nbsp; d = {} tbl = r'E:\gis\forestry\20120711_forestryWebApp\temp.gdb\wholeCity' with arcpy.da.SearchCursor(tbl, ['rangeClass', 'count']) as c: &amp;nbsp;&amp;nbsp;&amp;nbsp; for r in c: &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print r[0], r[1] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; #d[r[0]] = r[1] &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print d&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 18:26:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546047#M42574</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-07-19T18:26:35Z</dc:date>
    </item>
    <item>
      <title>Re: simple da.SearchCursor error</title>
      <link>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546048#M42575</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;HA HA HA HA!&amp;nbsp; I knew I was getting the weekend glazed eyes!&amp;nbsp; thanks!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 19 Jul 2012 19:21:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/simple-da-searchcursor-error/m-p/546048#M42575</guid>
      <dc:creator>KevinBell</dc:creator>
      <dc:date>2012-07-19T19:21:24Z</dc:date>
    </item>
  </channel>
</rss>

