I have prepared a Python code and I got the following errors:
"Parsing error IndentationError: expected an indented block (line 11)"
and
"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 os
import csv
import arcpy
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()
I:\GIS\HST_BP_GIS_Data.gdb
) and see if that works. Some ArcPy tools can't handle spaces.