I know how to add field to arcmap shapefile using Python:
import arcpy
arcpy.env.workspace = "H:pythonexerciseNZL_rdsNZL_roads.shp"
arcpy.AddField_management("NZL_roads", "LENGTH", "TEXT","","","50")
But how to make the python code prompt a window for “field”, “data type” and “length”? Also, what if I want add many fields at once like below:
- field “SPEEDLIMIT” data type as “num” and length “3″.
- field “BREADTH” datatype as “num” and length “4″
- field “LANE” datatype as “num” and length “4″
It should be dynamic, not fixed like my code.