Python Forum
Constructing a model - Beginner - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Homework (https://python-forum.io/forum-9.html)
+--- Thread: Constructing a model - Beginner (/thread-7747.html)



Constructing a model - Beginner - Rejano1993 - Jan-23-2018

Hey everybody!

I am starting to learn python by myself, specifically to use it in ArcGIS. I am creating right now a code to integrate it into a script. The tools i want to run within are: IDW (interpolation) and reclassification (Spatial analyst). The thing is that I would like to create a model without setting up the exactly values for a shp. since the beginning in case another person wants to work with in and implement any input related to what it is being calculating.
Unfortunately a message prompts up whenever I want to run the code saying "invalid syntax" and I am not able to see what's wrong.

Thanks for helping me out!

This is the entirely code:

import arcpy
from arcpy import env
from arcpy.sa import*
env.workspace("D:/Descargas/python/Lesson1")

try:

    inPointFeatures=""
    power=""
    searchRadius=""
    outIDW=Idw(inPointFeatures,power,searchRadius)
    outIDW.save""
    
    recl_value="VALUE"
    recl_data="DATA"
    outRecl=arcpy.sa.Reclassify(recl_rule,recl_value,recl_data)
    outRecl.save" "    
    outPath=arcpy.GetParameterAsText(1)
    arcpy.AddMessage("All done!")
    
except:
    arcpy.AddError("Something has failed")
    arcpy.AddMessage(arcpy.GetMessages(arcpy.AddMessage,arcpy.AddError))



RE: Constructing a model - Beginner - j.crater - Jan-23-2018

Hello, please post code in Python code tags and full error traceback message in error tags. You can find help here:
https://python-forum.io/misc.php?action=help&hid=25