[Tutor] escape-quoting strings
marilyn at deliberate.com
Mon Nov 1 23:08:48 CET 2004
On Sun, 31 Oct 2004, Chad Crabtree wrote:
> Marilyn Davis wrote:
> >I got it!!
> >This works:
> >ad0 = address.replace('\\', '\\\\')
> >ad0 = ad0.replace('\"','\\"')
> >db_style0 = '''%%%s%%''' % ad0
> >print "0:", db_style0
> I thought I should tell you about raw strings eg.
Thank you Chad. This might be helpful in another circumstance.
It goes to show that I'm clueless without the help here!
> out puts
> the r at the front automaticly escapes special characters.
> Do you Yahoo!?
> Y! Messenger - Communicate in real time. Download now.
More information about the Tutor