Hello,

I am getting the following -

>>> String = """<a href="http://www.rayslinks.com";>Ray's Links</a>"""
>>> String
'<a href="http://www.rayslinks.com";>Ray\'s Links</a>'

Note the magically appearing back slash in my result string. Now I tiry to escape the single quote.

>>> String = """<a href="http://www.rayslinks.com";>Ray\'s Links</a>"""
>>> String
'<a href="http://www.rayslinks.com";>Ray\'s Links</a>'

Once again the unwanted back slash appears.

>>> NewString = """'"""
>>> NewString
"'"
Hmmm, no back slash this time...

>>> String = """<a href="http://www.rayslinks.com";>Ray""" + """'""" + """s Links</a>"""
>>> String
'<a href="http://www.rayslinks.com";>Ray\'s Links</a>'

Why did quoting the single quote work in NewString when I triple quoted just the single quote, but not in the other examples where the result shows a back slash before my singe quote in String?

Is there a proper way to do this?

Thanks, Ray Parrish

--
Linux dpkg Software Report script set..
http://www.rayslinks.com/LinuxdpkgSoftwareReport.html
Ray's Links, a variety of links to usefull things, and articles by Ray.
http://www.rayslinks.com
Writings of "The" Schizophrenic, what it's like to be a schizo, and other
things, including my poetry.
http://www.writingsoftheschizophrenic.com


_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to