Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Update Cursor to enter name string in attribute field

$
0
0
All,

I need to modify my script to have the user's name entered into the MAPPER attribute field. Currently, the script enters inputName into the attribute field. I have a Parameter setup to Enter YOUR name as a string, but the script overwrites the name entered. I want the Enter YOUR Name string the value to be entered into the attribute table, not the inputName. My script is shown below. inputName is listed as the 2nd string, since this is only part of my script. I have another string set to 0.

Code:

#Import
import arcpy

#Name Variable
inputName = arcpy.GetParameterAsText(1)

#Permits the user to enter their name into the MAPPER field
try:       
        cursor = arcpy.da.UpdateCursor("Parcels", ["MAPPER"])
        for row in cursor:
                cursor.updateRow(["inputName"])
        arcpy.AddMessage("name entered")
        del row
        del cursor

except:
        print arcpy.GetMessages()


Viewing all articles
Browse latest Browse all 2485

Trending Articles