hsiddique

Error message in PythonWin that I dont understand

Discussion created by hsiddique on Jan 26, 2011
Latest reply on Jan 26, 2011 by Dan_Patterson
Hi all,
I'm at the very early learning stages of python, so please don't bite :o

I have the following code

import arcgisscripting
gp = arcgisscripting.create(9.3)
print "Tools imported"

gp.workspace = "C:/Temp"
print "Workspace set"

gp.overwriteoutput = 1
print "Overwrite set"

Input = "COVER63p.shp"
Output = "no_damage.shp"
Erase = "special_regions.shp"
print "variables set"

gp.erase_analysis(Input, Erase, Output)
print "tool has run...success"
print gp.messages()



Which should work, however when i run it in pythonwin (it takes about 15 minutes???) but also outputs this error in the interactive window.

>>> Tools imported
Workspace set
Overwrite set
variables set
tool has run...success
Traceback (most recent call last):
  File "C:\Python25\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
    exec codeObject in __main__.__dict__
  File "Z:\Data\Halil\Halil\ArcGIS\Python\Python\Homework\Erase.py", line 23, in <module>
    print gp.messages()
AttributeError: Object: Tool or environment <messages> not found
>>>

Can someone explain what it means because I haven't a clue.

Cheers

halil

Outcomes