AnsweredAssumed Answered

trying to enter data using tuple into Arcgis module

Question asked by analogdog on Feb 7, 2011
Latest reply on Feb 9, 2011 by clm42
# Import system modules
import sys, string, os, arcgisscripting

# Create the Geoprocessor object
gp = arcgisscripting.create(9.3)

# Check out any necessary licenses
gp.CheckOutExtension("spatial")

# Load required toolboxes...
gp.AddToolbox("C:/Program Files/ArcGIS/ArcToolbox/Toolboxes/Spatial Analyst Tools.tbx")

#Allocate the varibles
Elevfile = "C:\\GISWorkspace\\Kirkland\\kirkland_provided\\KirklandFlash\\DEM\\elev_gd"
gp.workspace = "c:/GISWorkspace/Kirkland/rasters"

#Set Annual Data into a Dictionary
data = [("Janimage", 175.32, 21.24), ("Febimage", 173.42, 29.61), ("Marimage", 174.05, 40.22), ("Aprimage", 176.26, 52.22), ("Mayimage", 177.23, 61.31), ("Juneimage" 174.56, 65.42), ("Julyimage", 174.97, 63.7), ("Augimage", 173.99, 56.25), ("Septimage", 178.4, 45.32),("Octimage", 181.47, 33.8), ("Novimage", 181.47, 23.87), (Decimage", 178.92, 19.16)]

#process the images

    while items in data:
        gp.HillShade_sa (Elevfile, a, b, c)


In checking the code, it bombs out giving me a sytax error near my second tuple. I don't get it the syntax appears like in Learning Python 3rd edition. Argh. So easy but so detailed.

Outcomes