Quantcast
Channel: Forums - Python
Viewing all articles
Browse latest Browse all 2485

Print a list of SDE datasources

$
0
0
Hi,
I am trying to print out a list of SDE datasources used by some MXDs in a folder. I can successfully print out a list of all the datasources, but I am having no luck separating out the sde connections. I have tried the following and a few other variations on the theme but I can't get anything to print out:

Code:

for lyr in arcpy.mapping.ListLayers(mxd):
    if lyr.supports("WORKSPACEPATH"):
          wsp = lyr.workspacePath
          if wsp == ("*.sde"):
              print lyr.dataSource

It seems like this should be pretty straight forward but I'm having no luck.
Can anyone point me in the right direction?
Thanks

Viewing all articles
Browse latest Browse all 2485

Trending Articles