Skip to content

Instantly share code, notes, and snippets.

@mfunk
Created October 16, 2015 17:20
Show Gist options
  • Save mfunk/a2d576c3f25d5c214b66 to your computer and use it in GitHub Desktop.
Save mfunk/a2d576c3f25d5c214b66 to your computer and use it in GitHub Desktop.

Revisions

  1. mfunk created this gist Oct 16, 2015.
    13 changes: 13 additions & 0 deletions GetApplication.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    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"