<?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: Error when running Search Cursor...HELP! in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172323#M64525</link>
    <description>&lt;P&gt;Bit hard to say, you haven't shown enough code. Do you define or import the&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;select_pour_point&lt;/FONT&gt; or&amp;nbsp;&lt;FONT face="courier new,courier"&gt;make_watershed_raster&lt;/FONT&gt; functions anywhere?&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 10 May 2022 08:51:43 GMT</pubDate>
    <dc:creator>Luke_Pinner</dc:creator>
    <dc:date>2022-05-10T08:51:43Z</dc:date>
    <item>
      <title>Error when running Search Cursor...HELP!</title>
      <link>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172261#M64523</link>
      <description>&lt;P&gt;I am receiving this error when running Search Cursor...HELP!&lt;/P&gt;&lt;P&gt;Error that is given:&lt;/P&gt;&lt;P&gt;Working on pour point 0&lt;/P&gt;&lt;P&gt;Traceback (most recent call last):&lt;BR /&gt;File "C:\Users\Chris\Desktop\Hawaii\hawaii_5.py", line 30, in &amp;lt;module&amp;gt;&lt;BR /&gt;cur_point = select_pour_point(POUR_POINTS, NAME_FIELD, name)&lt;BR /&gt;NameError: name 'select_pour_point' is not defined&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Part from my code that is giving the error:&lt;/P&gt;&lt;P&gt;for point in arcpy.da.SearchCursor(POUR_POINTS, NAME_FIELD):&lt;BR /&gt;name = str(point[0])&lt;/P&gt;&lt;P&gt;print "Working on pour point %s" % (name)&lt;BR /&gt;cur_point = select_pour_point(POUR_POINTS, NAME_FIELD, name)&lt;BR /&gt;shed_raster = make_watershed_raster(FLOW_DIRECTION, cur_point, name, SCRATCH)&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 02:03:08 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172261#M64523</guid>
      <dc:creator>AndreaB121</dc:creator>
      <dc:date>2022-05-10T02:03:08Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running Search Cursor...HELP!</title>
      <link>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172323#M64525</link>
      <description>&lt;P&gt;Bit hard to say, you haven't shown enough code. Do you define or import the&amp;nbsp;&lt;SPAN&gt;&lt;FONT face="courier new,courier"&gt;select_pour_point&lt;/FONT&gt; or&amp;nbsp;&lt;FONT face="courier new,courier"&gt;make_watershed_raster&lt;/FONT&gt; functions anywhere?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 08:51:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172323#M64525</guid>
      <dc:creator>Luke_Pinner</dc:creator>
      <dc:date>2022-05-10T08:51:43Z</dc:date>
    </item>
    <item>
      <title>Re: Error when running Search Cursor...HELP!</title>
      <link>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172424#M64527</link>
      <description>&lt;P&gt;You should &lt;A href="https://pro.arcgis.com/en/pro-app/latest/arcpy/get-started/data-access-using-cursors.htm" target="_self"&gt;review the documentation&lt;/A&gt;&amp;nbsp;for cursors and use it in a with statement like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="python"&gt;with arcpy.da.SearchCursor(POUR_POINTS, ["NAME_FIELD"]) as cursor:
    for point in cursor:
        name = str(point[0])
        print("Working on pour point {}".format(name))
        # Do stuff with data in cursor...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, as&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10780"&gt;@Luke_Pinner&lt;/a&gt;&amp;nbsp;mentioned, you need more of your code that shows where&amp;nbsp;&lt;FONT face="courier new,courier"&gt;select_pour_point&lt;/FONT&gt;&lt;SPAN&gt;&amp;nbsp;is defined. It must be defined before it is used.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 14:26:58 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/error-when-running-search-cursor-help/m-p/1172424#M64527</guid>
      <dc:creator>BlakeTerhune</dc:creator>
      <dc:date>2022-05-10T14:26:58Z</dc:date>
    </item>
  </channel>
</rss>

