Apr-29-2019, 07:06 AM
(This post was last modified: Apr-29-2019, 07:06 AM by Gribouillis.)
The point is that there are several ways to represent literally a string. The general idea is to use
repr()
>>> s = "some \" quo\u0074ed value'foo" >>> print(repr(s)) 'some " quoted value\'foo'You cannot be 100% sure to recover the initial form because the compiler interpretes the string and it doesn't remember that the " was initially escaped and ' was not for example, or that t was written \u0074