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 > >