<?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.AddMessage not working in python window in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119284#M9397</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings to all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mathew Thanks for your reply. However, I can not clarify this issue. These are the tests I've done using these two lines:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddMessage ("Hello")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Run these two lines in the ArcMap "Python" Window. Does not show the message....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Run these two lines in the Windows command line (cmd). It works. (Appears "hello")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Save these two lines as a script, add as a Toolbox and run the tool. I have used the&amp;nbsp; ArcMap "Python" window, ArcToolbox (running the tool) and the Windows command line. In all three cases, it works. In the first case, the result appears in the output window (right of the Python window). In the second case, the result appears in the progress dialog box of the tool. In the third case shows the outcome in the command line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, according to the link you sent me, this function "AddMessage" should work if not used in a script "stand-alone", as in the case of the Windows command line ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Surely I'm missing something ....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jesús de Diego&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 16 May 2012 20:49:56 GMT</pubDate>
    <dc:creator>Anonymous User</dc:creator>
    <dc:date>2012-05-16T20:49:56Z</dc:date>
    <item>
      <title>arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119279#M9392</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;this's a very frustrating problem: the addMessage function is not working for me in the Python Window. It works in a toolbox message window or in an IDE like WingIDE... but not in the Python Window...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;What is happening?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jesús de Diego&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 15 May 2012 22:17:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119279#M9392</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-05-15T22:17:47Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119280#M9393</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jesus,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you are using IDLE or PythonWin, you will want to use 'print'.&amp;nbsp; I use PythonWin so I use both 'print' and 'arcpy.AddMessage'.&amp;nbsp; That way I don't have to update any code when I run the script within ArcMap.&amp;nbsp; Ex:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;print "Succeeded"&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddMessage("Succeeded")&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 10:48:38 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119280#M9393</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2012-05-16T10:48:38Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119281#M9394</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Or, if you have to do it a lot, why not function?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;def printline(message):
&amp;nbsp;&amp;nbsp;&amp;nbsp; """printline(message)

&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; message(string):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; The message to be printed
&amp;nbsp;&amp;nbsp;&amp;nbsp; """
&amp;nbsp;&amp;nbsp;&amp;nbsp; print message
&amp;nbsp;&amp;nbsp;&amp;nbsp; arcpy.AddMessage(message)

printline("Hello World!")&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 06:58:12 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119281#M9394</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2021-12-11T06:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119282#M9395</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;yes, these are alternative ways, but: why can't I use addMessage in the Python Window? Can i?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;jesús de Diego&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 16:02:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119282#M9395</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-05-16T16:02:24Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119283#M9396</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;That is not was AddMessage was designed to do, so not currently no.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;See here under "Messaging in a dual-purpose script"&lt;/SPAN&gt;&lt;BR /&gt;&lt;A href="http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Writing_messages_in_script_tools/00150000000p000000/"&gt;http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Writing_messages_in_script_tools/00150000000p000000/&lt;/A&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 16:43:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119283#M9396</guid>
      <dc:creator>MathewCoyle</dc:creator>
      <dc:date>2012-05-16T16:43:29Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119284#M9397</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Greetings to all&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Mathew Thanks for your reply. However, I can not clarify this issue. These are the tests I've done using these two lines:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;import arcpy&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;arcpy.AddMessage ("Hello")&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;- Run these two lines in the ArcMap "Python" Window. Does not show the message....&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Run these two lines in the Windows command line (cmd). It works. (Appears "hello")&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- Save these two lines as a script, add as a Toolbox and run the tool. I have used the&amp;nbsp; ArcMap "Python" window, ArcToolbox (running the tool) and the Windows command line. In all three cases, it works. In the first case, the result appears in the output window (right of the Python window). In the second case, the result appears in the progress dialog box of the tool. In the third case shows the outcome in the command line.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;But, according to the link you sent me, this function "AddMessage" should work if not used in a script "stand-alone", as in the case of the Windows command line ...&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Surely I'm missing something ....&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;thank you in advance&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jesús de Diego&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 20:49:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119284#M9397</guid>
      <dc:creator>Anonymous User</dc:creator>
      <dc:date>2012-05-16T20:49:56Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119285#M9398</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Use the print statement, not the AddMessage functuion, for writing directly to the Python window. AddMessage is for running within geoprocessing tools, not for pushing text to the window of your Python interpreter.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 May 2012 21:24:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119285#M9398</guid>
      <dc:creator>JasonScheirer</dc:creator>
      <dc:date>2012-05-16T21:24:59Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy.AddMessage not working in python window</title>
      <link>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119286#M9399</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Oddly I did notice that arcpy.AddMessage&lt;/SPAN&gt;&lt;SPAN style="text-decoration:underline;"&gt; does&lt;/SPAN&gt;&lt;SPAN&gt; print if you run the script from the CMD window!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Which is very frustrating if you have doubled up with print messages, you get the messages twice.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 20 May 2012 07:31:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/arcpy-addmessage-not-working-in-python-window/m-p/119286#M9399</guid>
      <dc:creator>KimOllivier</dc:creator>
      <dc:date>2012-05-20T07:31:47Z</dc:date>
    </item>
  </channel>
</rss>

