Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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
add comment

1 Answer

up vote 10 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
add comment

Your Answer

 
discard

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.