Quotes

Tetsuo member at dbforums.com
Fri Dec 20 16:33:16 EST 2002


Originally posted by Chad Netzer 
> On Friday 20 December 2002 10:05, Tetsuo wrote:
> > All your suggestions can be broken if the outermost quotes
>     are
> > the same as something in the text...
>
> If you are algorithmically generating your strings (so that you
> don't necessarily know what quote characters are used inside them
> ahead of time), I think the best thing would be to always expand
> all instances of " or ', within the string, to \" and \'
> respectively.  Then you can use any style of outer quote you want
> and it shouldn't break.  And I think it is a clearer style than
> using chr().
>
> --
> Bay Area Python Interest Group -
> http://www.baypiggies.net/http://www.baypiggies.net/
>
> Chad Netzer
> cnetzer at mail.arc.nasa.gov 

Did you read the rest of my post?

--
Posted via http://dbforums.com



More information about the Python-list mailing list