<?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 Analyze Tools for Pro - Python Scripts - Faulty Results in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116621#M4791</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below link is from ArcGIS Pro Help for migrating ArcMap based python scripts to Pro based python scripts as they run in different versions of python.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/get-started/python-migration-for-arcgis-pro.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/get-started/python-migration-for-arcgis-pro.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;There is a section on fixing print statements where parentheses were not required in ArcMap (python 2.x), but parentheses are required in Pro (python 3.x).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Near the top of the help page is a link for "Analyze Tools for Pro" that is in blue.&amp;nbsp; This link shows a python script that can be run in Pro called&amp;nbsp;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;AnalyzeToolsForPro_management that will show you changes that need to be made to the script.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;Below is a sample line from the txt file run on a python script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;Line 57:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print("This is the feature class " + fc) -&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(("This is the feature class " + fc))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;This print statement should be OK in either python 2.x or python 3.x, but the tool suggested adding an additional parentheses around the print statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;As such, it seems like this tool is providing extraneous tips for upgrading python scripts that are misleading.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 16 Aug 2018 19:47:43 GMT</pubDate>
    <dc:creator>MichaelVolz</dc:creator>
    <dc:date>2018-08-16T19:47:43Z</dc:date>
    <item>
      <title>Analyze Tools for Pro - Python Scripts - Faulty Results</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116621#M4791</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;The below link is from ArcGIS Pro Help for migrating ArcMap based python scripts to Pro based python scripts as they run in different versions of python.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;&lt;A href="http://pro.arcgis.com/en/pro-app/arcpy/get-started/python-migration-for-arcgis-pro.htm"&gt;http://pro.arcgis.com/en/pro-app/arcpy/get-started/python-migration-for-arcgis-pro.htm&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;There is a section on fixing print statements where parentheses were not required in ArcMap (python 2.x), but parentheses are required in Pro (python 3.x).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="color: #1f497d;"&gt;Near the top of the help page is a link for "Analyze Tools for Pro" that is in blue.&amp;nbsp; This link shows a python script that can be run in Pro called&amp;nbsp;&lt;SPAN style="color: #595959; background-color: #f8f8f8;"&gt;AnalyzeToolsForPro_management that will show you changes that need to be made to the script.&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;Below is a sample line from the txt file run on a python script.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;Line 57:&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print("This is the feature class " + fc) -&amp;gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;print(("This is the feature class " + fc))&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;This print statement should be OK in either python 2.x or python 3.x, but the tool suggested adding an additional parentheses around the print statement.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #f8f8f8; color: #595959;"&gt;As such, it seems like this tool is providing extraneous tips for upgrading python scripts that are misleading.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 19:47:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116621#M4791</guid>
      <dc:creator>MichaelVolz</dc:creator>
      <dc:date>2018-08-16T19:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Analyze Tools for Pro - Python Scripts - Faulty Results</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116622#M4792</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;As I understand it, in 3.x print() is method that takes arguments.&amp;nbsp; Since&amp;nbsp;I'm at an impasse with v 2.2 I don't have access to Python3.x.&amp;nbsp; That said, my preference for any print statement is to use the format() method.&amp;nbsp; In your&amp;nbsp;examples:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'This is the feature class {}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp;&amp;nbsp; &lt;SPAN class="comment token"&gt;#v 2.x&lt;/SPAN&gt;

&lt;SPAN class="keyword token"&gt;print&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="string token"&gt;'This is the feature class {}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;fc&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&amp;nbsp; &lt;SPAN class="comment token"&gt;#v 3.x‍‍‍‍‍‍&lt;/SPAN&gt;&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;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;For that matter, I prefer using the format() method for concatenating variables, strings, paths, etc:&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;a &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'This is variable'&lt;/SPAN&gt;
b&amp;nbsp; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{} and this is another variable'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;a&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

dir &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; r&lt;SPAN class="string token"&gt;'C:\temp\junk'&lt;/SPAN&gt;
shape &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'joe.shp'&lt;/SPAN&gt;

shape &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="string token"&gt;'{}\{}'&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;format&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;dir&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt;shape&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;

&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;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:51:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116622#M4792</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-11T06:51:32Z</dc:date>
    </item>
    <item>
      <title>Re: Analyze Tools for Pro - Python Scripts - Faulty Results</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116623#M4793</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;That is good Joe... works in python used with ArcGIS Pro (ie 3.6.x)&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 16 Aug 2018 22:29:03 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116623#M4793</guid>
      <dc:creator>DanPatterson_Retired</dc:creator>
      <dc:date>2018-08-16T22:29:03Z</dc:date>
    </item>
    <item>
      <title>Re: Analyze Tools for Pro - Python Scripts - Faulty Results</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116624#M4794</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks... I mis-spoke.&amp;nbsp; I have Python 3.x with a Python window, just not Spyder.&amp;nbsp; Still waiting for an ESRI response to escalation...&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 17 Aug 2018 01:12:35 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/analyze-tools-for-pro-python-scripts-faulty/m-p/116624#M4794</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2018-08-17T01:12:35Z</dc:date>
    </item>
  </channel>
</rss>

