I am looking for a way to add text in the same line in the progress dialog box. The AddMessage() adds a newline and this is not convenient.

For example: I want to have one line with the text:

arcpy.AddMessage("Sorting data...Done")

where "Sorting data..." should appear before the execution of the tool and "Done" after it.

Is there a way to do this?

  • are you able to create an example - a mockup and post it? – TsvGis Jul 25 '15 at 6:55

I do not think that this can be done, and have never come across a requirement for it.

My only thought was to try a backspace (\b) so I tried the code below behind a Python script tool:

import arcpy

arcpy.AddMessage("Doing something ...")

arcpy.AddMessage ("\bDone")

When I ran it this is what appeared in the tool results dialog:

enter image description here

| improve this answer | |
  • I see. Maybe I should give up this effort. It would be nice though to have such an option! :-) – Panos Jul 24 '15 at 18:05
  • @Panos It's not one that I would vote for (without more convincing of a need for it), but you could post it to ArcGIS Ideas. – PolyGeo Jul 24 '15 at 18:31

I generally use something like this below (if I understand your question correctly)

import arcpy

arcpy.AddMessage("Sorting data")

# code to sort data...


This is an example from code I have used previously:

arcpy.AddMessage(".....Sorting chainages based on distance")

arcpy.Sort_management(Chainage_FC_Tempv2,chainage_FeatureClass, [["POINT_M", "ASCENDING"]])

arcpy.AddMessage("........Finished sorting chainages")
| improve this answer | |
  • @TsvGisThanks for the immediate reply. As I said on my question at the end of execution of the tool i want the text to be only in one line. Your example gives a 2 lines text! :-) – Panos Jul 24 '15 at 6:43
  • Sorry, I think I got confused with this line "where "Sorting data..." should appear before the execution of the tool and "Done" after it" – TsvGis Jul 24 '15 at 6:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.