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

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...