<?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: Cursor Not Working in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761574#M58749</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I got it to recognize the file but I’m getting a different error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of the script seems logical and the file works fine. This is the first time I’m running into this problem, where the cursor is not working and I am not getting much information from the IDLE on why.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 18 Nov 2016 16:25:19 GMT</pubDate>
    <dc:creator>alysaochoa2</dc:creator>
    <dc:date>2016-11-18T16:25:19Z</dc:date>
    <item>
      <title>Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761569#M58744</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;I'm writing a script to plot points and then delete rows that have a value of less than 5.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="the script" class="image-1 jive-image j-img-original" src="/legacyfs/online/265984_python script.png" style="width: 620px; height: 380px;" /&gt;&lt;/P&gt;&lt;P&gt;I am getting the following error on the cursor lines:&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt; File "C:\Users\30030839\Favorites\Downloads\pyfinal2.py", line 32, in &amp;lt;module&amp;gt;&lt;BR /&gt; cursor = arcpy.da.UpdateCursor("C:\\Users\\30030839\\Desktop\\Python\\capacity_points_layer2", ["DEM"])&lt;BR /&gt;RuntimeError: cannot open 'C:\Users\30030839\Desktop\Python\capacity_points_layer2'&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm not sure why this file isn't able to open. It's not being used in any application, and its folder is not open.I added the file to ArcMap previously to make sure the shapefile worked and that the attribute table exists, and it's fine. Does anyone know why I would be getting this error?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 15:59:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761569#M58744</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T15:59:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761570#M58745</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;So, what is this layer you are trying to run an update cursor on?&lt;/P&gt;&lt;P&gt;&lt;EM style="background-color: #ffffff;"&gt;cursor = arcpy.da.UpdateCursor("C:\\Users\\30030839\\Desktop\\Python\\capacity_points_layer2", ["DEM"])&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff;"&gt;It is not a shapefile, nor anything in a file geodatabase, so what is it and does it exist.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:07:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761570#M58745</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-18T16:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761571#M58746</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It’s a .lyr file. To test, I added it to ArcMap to make sure it worked. It seems like everything is fine and it should work. I also tried the cursor with .lyr and it did not help.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;[cid:image002.png@01D2417B.CC5CC3A0]&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:12:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761571#M58746</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T16:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761572#M58747</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Well, then it should have ".lyr" on the end as the extension. Do yourself a favour and in the file explorer, view setting untick to options which says "hide extensions for known file types".&lt;/P&gt;&lt;P&gt;But, I think an update cursor should be run on the data itself. Not a layer file which is a superset (including defrinitions and symbology) and a pointer to the data itself.&lt;/P&gt;&lt;P&gt;So, where is the feature you are trying to update and what is it?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:16:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761572#M58747</guid>
      <dc:creator>NeilAyres</dc:creator>
      <dc:date>2016-11-18T16:16:18Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761573#M58748</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The feature I am trying to update is saved in this path on my computer: C:&lt;BR /&gt;Users&lt;BR /&gt;30030839&lt;BR /&gt;Desktop&lt;BR /&gt;Python&lt;BR /&gt;capacity_points_layer2.lyr&lt;/P&gt;&lt;P&gt;It is a point shapefile.  I have attached the point shapefile if that helps.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Alysa Ochoa | Reporting Specialist, Business Intelligence | Bright Horizons Family Solutions | Phone: 720.644.2040 | alysa.ochoa@brighthorizons.com&amp;lt;mailto:alysa.ochoa@brighthorizons.com&amp;gt; | 2655 W. Midway Blvd., Suite 330 | Broomfield, CO 80020&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:21:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761573#M58748</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T16:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761574#M58749</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Now I got it to recognize the file but I’m getting a different error:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;All of the script seems logical and the file works fine. This is the first time I’m running into this problem, where the cursor is not working and I am not getting much information from the IDLE on why.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 16:25:19 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761574#M58749</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T16:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761575#M58750</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Can you post the updated code, please?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 17:20:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761575#M58750</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2016-11-18T17:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761576#M58751</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Here is the updated script. I have tested ALL other parts of the script and it works. Just the cursor is not working.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;According to this source from Esri, I should be able to just reference the layer to update the rows in the table.&amp;nbsp;&lt;A class="link-titled" href="http://pro.arcgis.com/en/pro-app/arcpy/functions/updatecursor.htm" title="http://pro.arcgis.com/en/pro-app/arcpy/functions/updatecursor.htm"&gt;UpdateCursor—ArcPy Functions | ArcGIS for Desktop&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/266066_python script.png" style="width: 620px; height: 550px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 18:23:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761576#M58751</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T18:23:42Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761577#M58752</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Rather than pointing the cursor to the .lyr file, can you try pointing it to the feature class that the .lyr refers to?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 18:27:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761577#M58752</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2016-11-18T18:27:10Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761578#M58753</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try this:&amp;nbsp;&lt;/P&gt;&lt;P&gt;with arcpy.da.UpdateCursor(newLayer, [field1]) as cursor:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Put the field variable in brackets.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 18:27:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761578#M58753</guid>
      <dc:creator>MitchHolley1</dc:creator>
      <dc:date>2016-11-18T18:27:57Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761579#M58754</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;Converting my layer to a feature class and referencing that feature class in the cursor worked!&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you so much for all of your help.&lt;/P&gt;&lt;P&gt;-AO&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 19:16:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761579#M58754</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T19:16:32Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761580#M58755</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Final completed script with no errors:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;IMG alt="" class="image-1 jive-image j-img-original" src="/legacyfs/online/266095_python script.png" style="width: 620px; height: 638px;" /&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 18 Nov 2016 19:21:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761580#M58755</guid>
      <dc:creator>alysaochoa2</dc:creator>
      <dc:date>2016-11-18T19:21:21Z</dc:date>
    </item>
    <item>
      <title>Re: Cursor Not Working</title>
      <link>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761581#M58756</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;You are misunderstanding the documentation.&amp;nbsp; A "layer" and "layer file" are not synonymous.&amp;nbsp; Cursors can work on datasets directly or layers/views of datasets, cursors do not work directly against layer files.&amp;nbsp; If you want to use a layer file, first use &lt;A href="http://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-feature-layer.htm"&gt;Make Feature Layer &lt;/A&gt;(if spatial) or &lt;A href="https://pro.arcgis.com/en/pro-app/tool-reference/data-management/make-table-view.htm"&gt;Make Table View &lt;/A&gt;to create a layer and then pass that layer to the cursor.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 19 Nov 2016 00:55:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/cursor-not-working/m-p/761581#M58756</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2016-11-19T00:55:00Z</dc:date>
    </item>
  </channel>
</rss>

