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