Python Forum
Constructing a model - Beginner
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Constructing a model - Beginner
#1
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))
Reply
#2
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
Reply


Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020