Solved! Go to Solution.
>>> '"STATE_NAME"=\'Illinois\' or '"STATE_NAME"=\'Indiana\'' SyntaxError: unexpected character after line continuation character >>>
>>> ' "STATE_NAME"=\'Illinois\' or "STATE_NAME"=\'Indiana\' ' ' "STATE_NAME"=\'Illinois\' or "STATE_NAME"=\'Indiana\' ' >>>
>>> query = '\"STATE_NAME\"=\'Illinois\' or \'\"STATE_NAME\"=\'Indiana\'' >>> print query "STATE_NAME"='Illinois' or '"STATE_NAME"='Indiana'
>>> query = '{0} IN ({1}, {2})'.format('"STATE_NAME"', "'Indiana'", "'Illinois'") >>> print query "STATE_NAME" IN ('Indiana', 'Illinois')
arcpy.SelectLayerByAttribute_management('mwstates','NEW_SELECTION',query)
>>> '"STATE_NAME"=\'Illinois\' or '"STATE_NAME"=\'Indiana\'' SyntaxError: unexpected character after line continuation character >>>
>>> ' "STATE_NAME"=\'Illinois\' or "STATE_NAME"=\'Indiana\' ' ' "STATE_NAME"=\'Illinois\' or "STATE_NAME"=\'Indiana\' ' >>>
query = ''' "STATE_NAME" IN ('Illinois', 'Indiana') '''