I want to ignore the escape character in the following code.
>>> a=['\%']
>>> print a
['\\%']
I want to output like ['\%']. Is there any way to do that?
Using string_escape, unicode_escape encoding (See Python Specific Encodings):
>>> a = ['\%']
>>> print str(a).decode('string_escape')
['\%']
>>> print str(a).decode('unicode_escape')
['\%']
    
'\\%' == '\%'- both represent a backslash character followed by a percent character.