I'm using ArcGIS Desktop 10 and have no experience using Python with a SQL Server ArcSDE database. When using a shp file or file gdb it is very simple to reference a given feature class by simply typing the file path to that file or gdb. However, this seems to be much different when working with mdf files with SQL Server. I can't find any help with this in the resource center. I did read some about making a arcsde connection but I had no luck with that. Any help with the Python code to do this would be a great help.
The way you typically connect to feature classes on an ArcSDE database in Python is to first create a SDE connection file using ArcCatalog or the
Then simply reference the feature class through it's Catalog Path (the path you see in ArcCatalog when you browse to an SDE feature class).
See this related question: How does one access a featurelayer in SDE via Python?