Stupid "\" question

Taz tariq.rashid at iname.com
Fri Nov 17 10:14:49 EST 2000


have a look at

re.escape

Gene C <gchiaramonte at yahoo.com> wrote in message
news:4O9R5.709$n9.126221 at newsread2.prod.itd.earthlink.net...
> 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