Quantcast
Channel: Question and Answer » arcpy
Viewing all articles
Browse latest Browse all 767

Checking if python script is run from ArcGIS (arcmap or on server) or a stand alone python script

$
0
0

For debugging purposes I have created a hardcoded conditional that checks it the script is run as stand alone or as an ArcGIS tool. Is there anyway to fugure this out at run time? e.g. some environment variable, global variable, etc.

e.g.

dryRun= 1
if dryRun:
    par= 'Hello'
else:
    par= arcpy.GetParameterAsText(0)
# Do something

Viewing all articles
Browse latest Browse all 767

Trending Articles