Hi,
how can i change this code to write to a file all field names of each feature class that exists in a geodatabase.
import arcpy
enviro = r"C:/EsriTraining/PYTH/Automate/"
arcpy.env.workspace = enviro +"{}".format("SanDiego.gdb")
field_list = arcpy.ListFields("MajorAttractions")
txtFile = open(enviro +"{}".format("Majorattractions.txt"),"w")
txtFile.write("MajorAttractions field information" + "\n")
txtFile.write("-------------------------------------" + "\n")
for field in field_list:
line = "Name: {}, Type: {}, Length: {}\n".format(
field.name, field.type, field.length)
txtFile.write(line)
txtFile.close()
Thank´s