I have prepared a python code and I got the following errors:
"Parsing error IndentationError: expected an indented block (line 11)"
"Runtime error Traceback (most recent call last): File "", line 10, in TypeError: 'NoneType' object is not iterable"
The purpose of the code is to list all feature datasets & feature classes from a single geodatabase into CSV.
import csv, arcpy, os from arcpy import env env.workspace = "I:\J_Prashant's External HD\High Speed Rail\Task from Greg Campbell\Layers\HST_BP_GIS_Data.gdb" datasetList = arcpy.ListDatasets('*','Feature') for dataset in datasetList: arcpy.env.workspace = dataset fcList = arcpy.ListFeatureClasses() for fc in fcList: print arcpy.env.workspace,fc csv_out = open('I:\\python\\List-Feature-Class\\test2.csv', 'wb') mywriter = csv.writer(csv_out) rows = zip(arcpy.env.workspace,fc) mywriter.writerows(rows) csv_out.close()