<?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: Different behavior in python scripting in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146296#M11432</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By chance, do you have &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/executing-tools/64bit-background.htm"&gt;64-bit Background Geoprocessing &lt;/A&gt;installed as well?&amp;nbsp; Personal geodatabases and Excel tables aren't supported with 64-bit Background Geoprocessing, so sometimes people have problems if it is installed and they have background processing enabled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 14 Oct 2015 15:50:50 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2015-10-14T15:50:50Z</dc:date>
    <item>
      <title>Different behavior in python scripting</title>
      <link>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146295#M11431</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;I've written a script in which I analyze the TOC content in a selected map document. The analysis produces a list of datasets (table, shapefile, geodatabase fc, raster, mosaic dataset, etc...) in the TOC. If a dataset has missing datasource the information will be also reported.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="text-decoration: underline;"&gt;&lt;EM&gt;Python code:&lt;/EM&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;import arcpy&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;# [.....]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;mxd = arcpy.mapping.MapDocument(mxdFilePath)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;# [.....]&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;dtfs = arcpy.mapping.ListDataFrames(mxd)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&lt;SPAN style="color: #000080;"&gt;for &lt;/SPAN&gt;dtf &lt;SPAN style="color: #000080;"&gt;in &lt;/SPAN&gt;dtfs:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; for dts in arcpy.mapping.ListLayers(mxd, "", dtf):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&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; if dts.supports("DATASOURCE"):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if not arcpy.Exists(dts.dataSource):&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&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;&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; file.write("\t&amp;nbsp; Missing datasource!&amp;nbsp; \n")&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&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;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; else:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca; font-family: 'courier new', courier;"&gt;&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;&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; # do something.............&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #3334ca;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;So I've created a &lt;STRONG&gt;Toolbox (tbx)&lt;/STRONG&gt;, added the script e run it: everything works well.&lt;/P&gt;&lt;P&gt;I've also embedded that script in a &lt;STRONG&gt;Python Toolbox (pyt)&lt;/STRONG&gt; and run it: everything works well but &lt;EM&gt;&lt;STRONG&gt;Personal Geodatabase&lt;/STRONG&gt;&lt;/EM&gt; feature classes return always a "missing datasource" message, althought the data exist and datasources are correctly set.&lt;/P&gt;&lt;P&gt;Finally, If I run the &lt;STRONG&gt;pyt&lt;/STRONG&gt; script as shown &lt;STRONG&gt;&lt;A href="http://blogs.esri.com/esri/arcgis/2012/12/14/how-to-debug-python-toolboxes-in-3-easy-steps/"&gt;here&lt;/A&gt;​&lt;/STRONG&gt;, again everything works well.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;So, I do something wrong in my Python Toolbox..... but what? Any help please?&lt;/P&gt;&lt;P&gt;Using Python 2.7.2 and ArcGIS 10.1.&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:13:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146295#M11431</guid>
      <dc:creator>AlbertoLaurenti</dc:creator>
      <dc:date>2015-10-14T15:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Different behavior in python scripting</title>
      <link>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146296#M11432</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;By chance, do you have &lt;A href="http://desktop.arcgis.com/en/desktop/latest/analyze/executing-tools/64bit-background.htm"&gt;64-bit Background Geoprocessing &lt;/A&gt;installed as well?&amp;nbsp; Personal geodatabases and Excel tables aren't supported with 64-bit Background Geoprocessing, so sometimes people have problems if it is installed and they have background processing enabled.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 14 Oct 2015 15:50:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146296#M11432</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2015-10-14T15:50:50Z</dc:date>
    </item>
    <item>
      <title>Re: Different behavior in python scripting</title>
      <link>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146297#M11433</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Yes Joshua, you're right!&lt;/P&gt;&lt;P&gt;I've disabled the Background geoprocessing and the pyt works perfectly.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 15 Oct 2015 07:06:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/different-behavior-in-python-scripting/m-p/146297#M11433</guid>
      <dc:creator>AlbertoLaurenti</dc:creator>
      <dc:date>2015-10-15T07:06:09Z</dc:date>
    </item>
  </channel>
</rss>

