Python ArcPy Tutorial | ArcPy Module In Python Tutorial

Python ArcPy is used to create a file and perform many other functions by using Python programming language. Learn more about it here.

createDissolvedGDB to create a file gdb on the workspace

def createDissolvedGDB(workspace, gdbName):
gdb_name = workspace + "/" + gdbName + ".gdb"
if(arcpy.Exists(gdb_name):
arcpy.Delete_management(gdb_name)
arcpy.CreateFileGDB_management(workspace, gdbName, "")
else:
arcpy.CreateFileGDB_management(workspace, gdbName, "")
return gdb_name

Python ArcPy: Printing one field’s value for all rows of feature class in file geodatabase using Search Cursor

To print a test field (TestField) from a test feature class (TestFC) in a test file geodatabase (Test.gdb) located in a temporary folder (C:\Temp):

with arcpy.da.SearchCursor(r"C:\Temp\Test.gdb\TestFC",["TestField"]) as cursor:
for row in cursor:
print row[0]

Learn More

LEAVE A REPLY

Please enter your comment!
Please enter your name here