Created
October 16, 2015 17:20
-
-
Save mfunk/a2d576c3f25d5c214b66 to your computer and use it in GitHub Desktop.
GetApplication() checks for Pro or Desktop as a Python snippet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def GetApplication(): | |
'''Return app environment as ARCMAP, ARCGIS_PRO, OTHER''' | |
try: | |
from arcpy import mp | |
return "ARCGIS_PRO" | |
except ImportError: | |
try: | |
from arcpy import mapping | |
mxd = arcpy.mapping.MapDocument("CURRENT") | |
return "ARCMAP" | |
except: | |
return "OTHER" | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment