<?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: Input parameter - ListRasters in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584086#M45812</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flip the search around and iterate the list of raster names and paths to evaluate, use os.path.basename to strip the raster name from the full path name.&amp;nbsp; Probably a much more elegant way to go about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#replicate a list of raster names&lt;/SPAN&gt;
raslist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'E:\blah\blah\mygdb.gdb\TDSDiff_y2013m288_y2013m12_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'E:\blah\blah\mygdb.gdb\TDSDiff_y2013m288_y2013m218_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'E:\blah\blah\mygdb.gdb\TDSDiff_y2040m218_y2013m218_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#specify the workspace where the rasters are located&lt;/SPAN&gt;
ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'H:\RasterExport\ras.gdb'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ws

&lt;SPAN class="comment token"&gt;#set a list of rasters in that workspace&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#iterate the list of rasters and evaluate whether or not the 3 rasters in the list exist in the workspace&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; rasternameAndPath &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; raslist&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basename&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rasternameAndPath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; rasterName &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; rasterName&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sun, 12 Dec 2021 01:06:44 GMT</pubDate>
    <dc:creator>JamesCrandall</dc:creator>
    <dc:date>2021-12-12T01:06:44Z</dc:date>
    <item>
      <title>Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584080#M45806</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am pretty new to python and have come across a problem that I am not understanding how to get around.&lt;/P&gt;&lt;P&gt;I am building a custom tool in ArcMap and it has an input form. On that form, one of the parameters is a multivalue list of rasters. &lt;/P&gt;&lt;P&gt;My&amp;nbsp;python script&amp;nbsp;is receiving that input parameter:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;inRasterB = arcpy.GetParameterAsText(3).split(';')&lt;/P&gt;&lt;P&gt;without any problems. I get a perfect, comma-delimited list.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;However, I need to loop through each of these individual&amp;nbsp;rasters the user has provided. I originally had it setup with a ListRasters(inRasterB), but when I started getting results for every raster in my geodatabase, I realized that this isn't going to work because the list is being used as the wildcard, which obviously&amp;nbsp;isn't going to match.&lt;/P&gt;&lt;P&gt;I tried changing my loop to iterate through the input directly:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #rasters = sorted(arcpy.ListRasters(inRasterB))&amp;nbsp;#original code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; #for raster in rasters: #original code&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for raster in inRasterB: #new code&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But now, it isn't recognizing those inputs as a list of rasters, but rather just a list of files (and can't find them on the filesystem due to the way geodatabases contain the rasters).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So........any thoughts on how&amp;nbsp;I can go about getting a specific list of rasters from the user and looping through those rasters, and only those rasters, rather than every raster in the directory/gdb?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 16:53:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584080#M45806</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-05T16:53:07Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584081#M45807</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Did you check the multivalue parameter options?&amp;nbsp; For any parameter, it can be set so that the list of raster comes from the geodatabase, but the user can select more than one from the list&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 17:25:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584081#M45807</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-04-05T17:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584082#M45808</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#replicate a list of raster names&lt;/SPAN&gt;
raslist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'TDSDiff_y2013m288_y2013m12_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'TDSDiff_y2013m288_y2013m218_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'TDSDiff_y2040m218_y2013m218_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#specify the workspace where the rasters are located&lt;/SPAN&gt;
&lt;SPAN class="comment token"&gt;#in my test, this workspace contains 6 rasters in total includes 3 in replicated list above&lt;/SPAN&gt;
ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'H:\ras.gdb'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ws

&lt;SPAN class="comment token"&gt;#set a list of rasters in that workspace&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#iterate the list of rasters and evaluate whether or not the 3 rasters in the list exist in the workspace&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; raster &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; raster &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; raslist&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; raster&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:06:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584082#M45808</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T01:06:41Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584083#M45809</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That sounds perfect. I will give that a go shortly. Thanks a ton!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 17:30:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584083#M45809</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-05T17:30:07Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584084#M45810</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;It didn't work. The list that comes through is like ['E:\blah\blah\mygdb.gdb\someraster1', 'E:\blah\blah\mygdb.gdb\someraster2', etc...]&lt;/P&gt;&lt;P&gt;And the listRasters() is coming back with just 'someraster1' or 'someraster2' (rather than the full path), so they aren't matching what's in the list. Maybe I need to split the list one additional time&amp;nbsp;and pull out whatever characters are at the end up until the first '\'? Not sure how to go about that offhand, but does it sounds plausible.....?&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 17:38:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584084#M45810</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-05T17:38:00Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584085#M45811</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;List functions are always relative to the active workspace, so you'd need to &lt;SPAN style="font-family: courier new,courier,monospace;"&gt;os.path.join(ws,raster)&lt;/SPAN&gt; to reconstruct the fully qualified path.&lt;/P&gt;&lt;P&gt;- V&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 05 Apr 2018 17:51:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584085#M45811</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2018-04-05T17:51:10Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584086#M45812</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Flip the search around and iterate the list of raster names and paths to evaluate, use os.path.basename to strip the raster name from the full path name.&amp;nbsp; Probably a much more elegant way to go about it.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;#replicate a list of raster names&lt;/SPAN&gt;
raslist &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="punctuation token"&gt;[&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'E:\blah\blah\mygdb.gdb\TDSDiff_y2013m288_y2013m12_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'E:\blah\blah\mygdb.gdb\TDSDiff_y2013m288_y2013m218_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'E:\blah\blah\mygdb.gdb\TDSDiff_y2040m218_y2013m218_111'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;]&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#specify the workspace where the rasters are located&lt;/SPAN&gt;
ws &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'H:\RasterExport\ras.gdb'&lt;/SPAN&gt;
arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;env&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;workspace &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; ws

&lt;SPAN class="comment token"&gt;#set a list of rasters in that workspace&lt;/SPAN&gt;
rasters &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; arcpy&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;ListRasters&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'*'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&lt;SPAN class="comment token"&gt;#iterate the list of rasters and evaluate whether or not the 3 rasters in the list exist in the workspace&lt;/SPAN&gt;
&lt;SPAN class="keyword token"&gt;for&lt;/SPAN&gt; rasternameAndPath &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; raslist&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; rasterName &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; os&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;path&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;basename&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;rasternameAndPath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;if&lt;/SPAN&gt; rasterName &lt;SPAN class="keyword token"&gt;in&lt;/SPAN&gt; rasters&lt;SPAN class="punctuation token"&gt;:&lt;/SPAN&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; rasterName&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 01:06:44 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584086#M45812</guid>
      <dc:creator>JamesCrandall</dc:creator>
      <dc:date>2021-12-12T01:06:44Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584087#M45813</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That seems to have gotten me further, but now it appears that the basename line is acting odd. I put (how do you get that handy gray box for the code?):&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; rasters = arcpy.ListRasters('*')&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Raster1 for " + str(rasters)) &lt;EM&gt;#help debug - This line looks fine, just a big list&lt;/EM&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; for rasterfull in inRasterBot:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Raster2 for " + rasterfull) &lt;EM&gt;#help debug - This line looks fine, full path surrounded by single quotes&lt;/EM&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; raster = os.path.basename(rasterfull)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Raster3 for " + raster) &lt;EM&gt;#help debug - This line&amp;nbsp;looks bad, has a ' at the end of the raster name (UnitAB_DEM_bottom'). I am guessing it is because it is bringing everything after the last&amp;nbsp;\ maybe?&lt;/EM&gt;&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if raster in rasters:&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; unit = raster.split('_')[0]&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage("Processing Raster4 for " + unit) &lt;EM&gt;#help debug - Never makes it here&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am going to try to do something to remove that last ' on the basename line and see if that helps.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 12:11:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584087#M45813</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-06T12:11:31Z</dc:date>
    </item>
    <item>
      <title>Re: Input parameter - ListRasters</title>
      <link>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584088#M45814</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I changed the basename line to:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;os.path.basename(rasterfull)[0:-1]&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;And it seems to be working now. It is at least running and going through each of the rasters instead of immediately ending "successfully". Thanks for the help!!!! I really appreciate it.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 06 Apr 2018 12:17:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/input-parameter-listrasters/m-p/584088#M45814</guid>
      <dc:creator>ChrissyWhite</dc:creator>
      <dc:date>2018-04-06T12:17:41Z</dc:date>
    </item>
  </channel>
</rss>

