Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I recently exported an ArcGIS model to python and was reviewing the script and am confused by the following line:

if TRU_W_DatableFeatures == '#' or not TRU_W_DatableFeatures:

I can't seem to find a clear answer as to the role of the '#' and am quite confused about what is going on here... Any help or nudges towards an existing explanation are greatly appreciated!

share|improve this question
up vote 11 down vote accepted

You'll notice that TRU_W_DatableFeatures is an optional input. When ArcGIS calls a Python script with optional arguments it will pass in a # in place of an optional argument that has not been filled out. This is because Python arguments are positional.

Otherwise if you were calling this script from Python instead of ArcGIS you (may) not set TRU_W_DatableFeatures.

So this if statement is checking for the existence of TRU_W_DatableFeatures, and whatever is within this if statement will only be performed if TRU_W_DatableFeatures exists.

share|improve this answer
Thank you. I suspected something along those lines. Really appreciate the help! – Kevin Dec 14 '12 at 23:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.