<?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: How to show printed text from Script Tool? in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557508#M73175</link>
    <description>&lt;P&gt;That is going to be a different problem.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;is right, replace print() with arcpy.AddMessage().&lt;/P&gt;</description>
    <pubDate>Tue, 12 Nov 2024 14:33:41 GMT</pubDate>
    <dc:creator>AlfredBaldenweck</dc:creator>
    <dc:date>2024-11-12T14:33:41Z</dc:date>
    <item>
      <title>How to show printed text from Script Tool?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557477#M73171</link>
      <description>&lt;P&gt;Hi, I work on arcGIS Desktop 10.8 with python 2.7&lt;/P&gt;&lt;P&gt;Executing the python code from Geoprocessing window I've managed to print the count value of table's selected rows . The problem is that I want to store the code inside a toolbox, to do so I've added a script inside the toolbox but when I run it it get stuck and never show me the printed value.&lt;/P&gt;&lt;P&gt;This is the code:&lt;/P&gt;&lt;P&gt;import arcpy&lt;BR /&gt;&lt;BR /&gt;tabella = "Name_of_the_table"&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;conteggio_selezionato = 0&lt;BR /&gt;&lt;BR /&gt;count = arcpy management GetCount(tabella)[0] # Restituisce una stringa&lt;BR /&gt;if count != "0":&lt;BR /&gt;&lt;BR /&gt;with arcpy da SearchCursor(tabella, "*", "OBJECTID IS NOT NULL") as cursor:&lt;BR /&gt;for row in cursor:&lt;BR /&gt;conteggio_selezionato += 1&lt;BR /&gt;&lt;BR /&gt;print "Numero di righe selezionate: {}" format(conteggio_selezionato)&lt;BR /&gt;else:&lt;BR /&gt;print "Nessuna riga selezionata "&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 13:36:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557477#M73171</guid>
      <dc:creator>TeresaBartolomei</dc:creator>
      <dc:date>2024-11-12T13:36:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to show printed text from Script Tool?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557490#M73172</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/851041"&gt;@TeresaBartolomei&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;Replace&amp;nbsp;&lt;STRONG&gt;print&amp;nbsp;&lt;/STRONG&gt;with &lt;A href="https://desktop.arcgis.com/en/arcmap/latest/analyze/arcpy-functions/addmessage.htm" target="_self"&gt;arcpy.AddMessage&lt;/A&gt;.&amp;nbsp; Ex:&lt;/P&gt;
&lt;LI-CODE lang="python"&gt;arcpy.AddMessage("Nessuna riga selezionata")&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 13:55:22 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557490#M73172</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2024-11-12T13:55:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to show printed text from Script Tool?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557497#M73173</link>
      <description>&lt;P&gt;Same, actually it doesn' get stuck but it never ends executing:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TeresaBartolomei_0-1731420414660.png" style="width: 400px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/119276iA76552BBC8EAEB77/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TeresaBartolomei_0-1731420414660.png" alt="TeresaBartolomei_0-1731420414660.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;maybe it's because it has no output parameter?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 14:07:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557497#M73173</guid>
      <dc:creator>TeresaBartolomei</dc:creator>
      <dc:date>2024-11-12T14:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: How to show printed text from Script Tool?</title>
      <link>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557508#M73175</link>
      <description>&lt;P&gt;That is going to be a different problem.&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/10527"&gt;@JakeSkinner&lt;/a&gt;&amp;nbsp;is right, replace print() with arcpy.AddMessage().&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2024 14:33:41 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/how-to-show-printed-text-from-script-tool/m-p/1557508#M73175</guid>
      <dc:creator>AlfredBaldenweck</dc:creator>
      <dc:date>2024-11-12T14:33:41Z</dc:date>
    </item>
  </channel>
</rss>

