How To Ignore The Escaping \ Python List?
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?
Solution 1:
Using string_escape
, unicode_escape
encoding (See Python Specific Encodings):
>>>a = ['\%']>>>printstr(a).decode('string_escape')
['\%']
>>>printstr(a).decode('unicode_escape')
['\%']
Post a Comment for "How To Ignore The Escaping \ Python List?"