def ValidateList(in_list, in_value): try: inputList.index(Input_Layer) return 1 except ValueError: print ("Input '" + in_value + "' is invalid.") print ("Input should be one of the following:") for curItem in inputList: print curItem return 0 # Script arguments Input_Layer = 'Test' if Input_Layer == '#' or not Input_Layer: Input_Layer = "Parcels" # provide a default value if unspecified inputList = ['Parcels', 'RollBoundary'] if ValidateList(inputList, Input_Layer): print ("Put execution code here.")
Signed in members can post, follow updates, and more. New here? Register a free account.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.