I am trying to perform a SearchCursor or alternatively a SelectLayerByAttribute where the data will sometimes contain special characters, like apostrophes, dashes, and slashes. I'm trying to figure out how to make the apostrophes work in my query. eg. featureclass = r"C:\my feature class"
qry = "Item_Name = 'John's Cabin' "
arcpy.SearchCursor(featureclass, qry)
that of course doesn't work. But I've tried a few different things, and none works. I've tried: qry = "John\'s Cabin"; John''s Cabin and neither work. Any other suggestions?