How do I remove all the backslashes from a string in Python?
This is not working for me:
result = result.replace("\\", result)
Do I need to treat result as a raw string?
Your code is saying to replace each instance of
result. Have you tried changing it to
result.replace("\\", "") ?
decode('string_escape'), for example:
result = stringwithbackslashes.decode('string_escape')
string_escape : Produce a string that is suitable as string literal in Python source code