I need to differentiate between two possible types of workspaces for an arcpy script. So I check the workspaceType
:
rootWorkspace = raw_input('Geodatabase workspace to analyze: ')
desc = arcpy.Describe(rootWorkspace)
wsType = desc.workspaceType
print 'Workspace Type: {}'.format(wsType)
which seems to work fine and prints the correct type. But, if I try to then check the type (so I can, eventually, do different things depending on what it is):
if wsType is 'FileSystem': print 'file system'
if wsType is 'LocalDatabase': print 'gdb'
if wsType is 'RemoteDatabase': print 'sde'
else: print 'not reading this correctly'
I always get not reading this correctly
(whether I'm inputting a directory or geodatabase).
According to Arc help about Workspace properties, workspaceType
should be a string result (not an Object etc.), so I am confused why a string comparison isn't working.
elif
statements for the last 2if
's.