Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I wrote the following code as a wrapper around messages pushed durring the running of the script. Using Python IDLE this works fine, but in eclipse I get the following output:

def ESRIP(gp,message):
    """Prints messages into ArcGIS Script window"""
    message = str(message)
    gp.AddMessage(message)
    return message    

print ESRIP(gp, "processing one million points")

Any thoughts on how I can remove the weird text?

share|improve this question
2  
I suggest changing the title of the question to "Geoprocessor AddMessage issue in Eclipse" for a bit more description. –  om_henners Aug 5 '10 at 2:01
    
I can't seem to figure out how to change the title, I will be clearer in the future –  GuidoS Aug 5 '10 at 14:20

1 Answer 1

up vote 3 down vote accepted

I've had the same issue. In those cases where it was really a problem, I just added a print for the message, and commented out the gp.AddMessage while I was testing in Eclipse, then uncommented it when moving it into ArcGIS.

Interestingly the gp.AddMessage works fine when run from the Python command line. Not sure where the extra characters are coming from (maybe AddMessage returns an unescaped string or something). I suspect it comes down to each interface's way of handeling unknown characters - command promt ignores them, IDLE doesn't print the string, and Eclipse tries to print the unknown characters.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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