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'm trying to run this very simple script to check a problem in another more comlpex one.

import arcpy
arcpy.env.workspace= 'C:\\Users\\Umberto\\Desktop\\Prove_Script\\Karakoram\\temporary_01'

rst= arcpy.listRasters ()
print rst

I didn't find out what's the matter so far. In python console within arcgis it works without any problem. It gives me this error:

Traceback (most recent call last):
  File "C:\Python27\ArcGIS10.1\Lib\site-  packages\pythonwin\pywin\framework\scriptutils.py", line 326, in RunScript
    exec codeObject in __main__.__dict__
  File     "C:\Users\Umberto\Documents\UniversitᝐhD\Karakoram\MODIS_Pakistan\Script\test_listClip.py",     line 4, in <module>
    rst= arcpy.listRasters ()
AttributeError: 'module' object has no attribute 'listRasters'
share|improve this question

1 Answer 1

up vote 4 down vote accepted

arcpy.ListRasters is capitalised, your code should be:

rst= arcpy.ListRasters ()
share|improve this answer
    
so simple... Thank You so much, the other time I've been using this function I didn't do such a mistake... –  umbe1987 Jan 28 '13 at 13:05

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.