<?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: Arcpy workflow fails to execute in ArcGIS API for Python Questions</title>
    <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856029#M4002</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;lacking data to test with, have you tried throwing a print statement in before writing the file in the try-except block.&lt;/P&gt;&lt;P&gt;better still, maybe get rid of the try-except block so you get an error message that might be useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 20 Sep 2018 14:03:05 GMT</pubDate>
    <dc:creator>DanPatterson_Retired</dc:creator>
    <dc:date>2018-09-20T14:03:05Z</dc:date>
    <item>
      <title>Arcpy workflow fails to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856027#M4000</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I have a python workflow created to read image files (in folders)&amp;nbsp;and simply write the&amp;nbsp;raster attributes to a text file. The script runs&amp;nbsp;up to line 7, writes out the header, and&amp;nbsp;aborts without reporting any error. I can't figure out what&amp;nbsp;issues are hidden in lines 8 - 20. I use 10.3.1.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;import arcpy, sys, os
from arcpy import env
env.workspace = "Z:\..."
root_folder = env.workspace
out_file = open("Z:\....txt","a")
#Next line creates an header to properly identify the properties.
out_file.write("BANDCOUNT"+'\t'+"CATALOGPATH"+'\t'+"COMPRESSIONTYPE"+'\t'+"EXTENT"+'\t'+"FORMAT"+'\t'+"HASRAT"+'\t'+"HEIGHT"+'\t'+"MAXIMUM"+'\t'+"MINIMUM"+'\t'+"ISINTEGER"+'\t'+"MEANCELLHEIGHT"+'\t'+"MEANCELLWIDTH"+'\t'+"NAME"+'\t'+"NODATAVALUE"+'\t'+"PATH"+'\t'+"PIXELTYPE"+'\t'+"SPATIALREFERENCE"+'\t'+"STANDARDDEVIATION"+'\t'+"UNCOMPRESSEDSIZE"+'\t'+"WIDTH"+'\n') 
ext = [".bil",".bip",".bsq",".bmp",".flv",".img",".dt0",".dt1",".dt2",".ecw",".img",".raw",".grd",".gif",".hgt",".jpg",".jpeg",".jpc",".jpe",".sid",".view",".png",".tif",".tiff"]
for root, dirs, files in os.walk(root_folder):
&amp;nbsp;&amp;nbsp;&amp;nbsp; for filename in files:
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if filename.endswith(tuple(ext)):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; try:
&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;&amp;nbsp;&amp;nbsp; raspath = root + "\\" + filename
&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;&amp;nbsp;&amp;nbsp; ras = arcpy.Raster(raspath)
&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;&amp;nbsp;&amp;nbsp; rasDescription = (str(ras.bandCount) +'\t'+ str(ras.catalogPath)+'\t' +str(ras.compressionType)+'\t'+ str(ras.extent)+'\t'+'\t'+'\t'+'\t'+str(ras.format)+'\t'+str(ras.hasRAT)+'\t'+str(ras.height)+'\t'+str(ras.maximum)+'\t'+ str(ras.minimum)+'\t'+str(ras.isInteger)+'\t'+ str(ras.meanCellHeight)+'\t'+str(ras.meanCellWidth)+'\t'+str(ras.name)+'\t'+str(ras.noDataValue)+'\t'+str(ras.path)+'\t'+str(ras.pixelType)+'\t'+str(ras.spatialReference)+'\t'+str(ras.standardDeviation)+'\t'+str(ras.uncompressedSize)+'\t'+str(ras.width))
&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;&amp;nbsp;&amp;nbsp; out_file.write(rasDescription+'\n')
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; except RuntimeError:
&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;&amp;nbsp;&amp;nbsp; continue&amp;nbsp; 
out_file.flush()
out_file.close()‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍‍&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;/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 10:34:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856027#M4000</guid>
      <dc:creator>Stephen_A_Oladayiye</dc:creator>
      <dc:date>2021-12-12T10:34:59Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy workflow fails to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856028#M4001</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Sharing with &lt;A href="https://community.esri.com/space/2145"&gt;Python&lt;/A&gt;‌&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 13:47:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856028#M4001</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2018-09-20T13:47:45Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy workflow fails to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856029#M4002</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;lacking data to test with, have you tried throwing a print statement in before writing the file in the try-except block.&lt;/P&gt;&lt;P&gt;better still, maybe get rid of the try-except block so you get an error message that might be useful&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 14:03:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856029#M4002</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-09-20T14:03:05Z</dc:date>
    </item>
    <item>
      <title>Re: Arcpy workflow fails to execute</title>
      <link>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856030#M4003</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Either use raw strings (r'Z:\...') or forward slashes in your paths. I'm guessing nothing triggers the if statement, or possibly nothing is read into walk, at all, because the paths are incorrect.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 20 Sep 2018 17:22:16 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-api-for-python-questions/arcpy-workflow-fails-to-execute/m-p/856030#M4003</guid>
      <dc:creator>DarrenWiens2</dc:creator>
      <dc:date>2018-09-20T17:22:16Z</dc:date>
    </item>
  </channel>
</rss>

