Calculating Fields

724
4
05-04-2012 07:45 AM
MichelleCouden1
Occasional Contributor III
My program is working up until the CalculateField, because you can see all the responses to script working. What am I missing in the calulate field script? See Below :

import arcpy
>>> import os.path
>>> os.path.basename ("C:\Users\Michelle\Desktop\GIS\FA_Urbans.shp")
'FA_Urbans.shp'
>>> arcpy.AddField_management ("FA_Urbans", "POPSQMI","TEXT", "20")
<Result 'FA_Urbans'>
>>> arcpy.CalculateField_management ("FA_Urbans","POPSQMI", "!SQMI!/!FID_1!","PYTHON"
...

See the dots it didn't like the calculate field. Every thing is working until then. The field is added and eveything but no calculation. I'm thinking it didn't like text.
Tags (2)
0 Kudos
4 Replies
DarrenWiens2
MVP Honored Contributor
You're missing the very last parentheses...parenthesis... this ---> )
0 Kudos
DuncanHornby
MVP Notable Contributor
Michelle,

If you've copied your script correctly then you are missing a bracket at the end of your line.

arcpy.CalculateField_management ("FA_Urbans","POPSQMI", "!SQMI!/!FID_1!","PYTHON")
0 Kudos
MichelleCouden1
Occasional Contributor III
DUUUHHHH! Thanks!
0 Kudos
AnthonyTimpson2
Occasional Contributor
Michelle It is really bad form to start multiple related threads in the forum, stick to one thread....
0 Kudos