How do I ignore all escape characters in a string?
Fx: \n \t %s
So if I have a string:
text = "Hello \n My Name is \t John"
Now if I print the string the output will be different than the actual string:
Hello My Name is John
How can I print the 'actual string' like this:
Hello \n My Name is \t John
Here is an example, which doesn't work:
text = "Hello \n My Name is \t John"
text.replace('\n', '\\n').replace('\t', '\\t')
print text
This does not work! No difference
I have looked at some topics where you could remove them, but I DO not want that. How do I ignore them? So we can see the actual string?