I want that one variable takes input from the user and then we compare the value to the attribute.
val = input("Ask user for something.")arcpy.SelectLayerByAttribute_management("Sample", "NEW_SELECTION", """ "ATTRIBUTENAME" = 'val' """)In this as we have to put apostrophes around "val" it takes it as string not as variable whose value we want to compare. So any way by which we can do this?
أكثر...
val = input("Ask user for something.")arcpy.SelectLayerByAttribute_management("Sample", "NEW_SELECTION", """ "ATTRIBUTENAME" = 'val' """)In this as we have to put apostrophes around "val" it takes it as string not as variable whose value we want to compare. So any way by which we can do this?
أكثر...