Backslash substitutions

Vivien Mallet Vivien.Mallet at ecl2002.ec-lyon.fr
Wed Sep 29 21:09:43 CEST 2004


Hello,

How would you perform backslash substitution in a string, just like the
Python parser does?

Example:
---
>>> s = "\\n"
>>> print s
\n
>>> print ???(s)


>>>
---
where '???' is a function that I wasn't able to find.

Just in case, another example:
---
>>> s = "\\\\A\\tB"
>>> print s
\\A\tB
>>> print ???(s)
\A      B
>>>
--- 

Thank you.



More information about the Python-list mailing list