Python ArcGIS 10 – list all FeatureClasses in SDE-FeatureDataset (to txt-File)

If you want to list  and write to a txt-File all featureClasses (in a FetaureDataset) stored in SDE/Oracle, it is done with a few line Python.

import arcpy
from arcpy import env
import os

# Set the workspace for the ListFeatureClass function
env.workspace = "Database Connections/VECTOR.arcsde01.sde/FEATURE_DATASET"

# Use the ListFeatureClasses function to return a list of 
#  all shapefiles.
fcList = arcpy.ListFeatureClasses()

print str(fcList)

# setting up output-file and write to file
file = open("sdelayers.txt", "w")