Re: Quoting quotes

2010-02-28 Thread candide
OK, now I see the point. I was mistaken because I was supposing that every quote strictly _inside_ the string have to match another quote od the same type. Thanks to all for yours responses. -- http://mail.python.org/mailman/listinfo/python-list

Re: Quoting quotes

2010-02-26 Thread Lawrence D'Oliveiro
In message , William Lohrmann wrote: > The best thing would be to backslash the single quote: print 'The play > "All\'s Well That Ends Well"' Backslash-type escapes are the most general solution to this type of problem. They’re also the easiest to apply automatically: for ch in input_stri

Re: Quoting quotes

2010-02-26 Thread William Lohrmann
On 26 Feb, 13:29, candide wrote: > Suppose you have to put into a Python string the following sentence : > > The play "All's Well That Ends Well" by Shakespeare > > It's easy do it : > > >>> print """The play "All's Well That Ends Well" by Shakespeare""" > > The play "All's Well That Ends Well" by

Re: Quoting quotes

2010-02-26 Thread Grant Edwards
On 2010-02-26, Steven D'Aprano wrote: > On Fri, 26 Feb 2010 13:29:04 +0100, candide wrote: > >> But the first method doesn't run correctly : >> >> > print """The play "All's Well That Ends Well >> File "", line 1 >> print """The play "All's Well That Ends Well >>

Re: Quoting quotes

2010-02-26 Thread Steven D'Aprano
On Fri, 26 Feb 2010 13:29:04 +0100, candide wrote: > But the first method doesn't run correctly : > > print """The play "All's Well That Ends Well > File "", line 1 > print """The play "All's Well That Ends Well >^ > SyntaxEr

Re: Quoting quotes

2010-02-26 Thread Benjamin Kaplan
On Fri, Feb 26, 2010 at 7:29 AM, candide wrote: > Suppose you have to put into a Python string the following sentence : > > The play "All's Well That Ends Well" by Shakespeare > > It's easy do it : > > >>> print """The play "All's Well That Ends Well" by Shakespeare""" > The play "All's Well That

Re: Quoting quotes

2010-02-26 Thread Victor Stinner
Le vendredi 26 février 2010 13:29:04, candide a écrit : > But the first method doesn't run correctly : > >>> print """The play "All's Well That Ends Well > > File "", line 1 > print """The play "All's Well That Ends Well >^ > Syntax

Re: Quoting quotes

2010-02-26 Thread Ivan Šipoš
On 26.2.2010. 13:29, candide wrote: Suppose you have to put into a Python string the following sentence : The play "All's Well That Ends Well" by Shakespeare It's easy do it : print """The play "All's Well That Ends Well" by Shakespeare""" The play "All's Well That Ends Well" b