Stupid "\" question

Gene C gchiaramonte at yahoo.com
Fri Nov 17 13:48:00 CET 2000


If I get an input string from a user or file like this:  "a\b\c"
How do I convert it to this:  "a\\b\\c"

Desired behavior:

>>> s = "a\b\c"
>>> t = doit(s)  # ???
>>> t
"a\\b\\c"

Thanks,

Gene





More information about the Python-list mailing list