Tuesday, 25 August 2015

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


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


No comments:

Post a Comment