<br><br><div class="gmail_quote">On Fri, Feb 26, 2010 at 7:29 AM, candide <span dir="ltr"><candide@free.invalid></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
Suppose you have to put into a Python string the following sentence :<br>
<br>
The play "All's Well That Ends Well" by Shakespeare<br>
<br>
It's easy do it :<br>
<br>
>>> print """The play "All's Well That Ends Well" by Shakespeare"""<br>
The play "All's Well That Ends Well" by Shakespeare<br>
<br>
Now, change the sentence to this one :<br>
<br>
The play "All's Well That Ends Well"<br>
<br>
Using triple single quotes works fine<br>
<br>
>>> print '''The play "All's Well That Ends Well"'''<br>
The play "All's Well That Ends Well"<br>
<br>
<br>
But the first method doesn't run correctly :<br>
<br>
<br>
>>> print """The play "All's Well That Ends Well""""<br>
File "<stdin>", line 1<br>
print """The play "All's Well That Ends Well""""<br>
^<br>
SyntaxError: EOL while scanning single-quoted string<br>
>>><br>
<br>
<br>
Any comment ?<br>
<div><div></div><div class="h5"><br>
<br></div></div></blockquote><div><br><br>You have 4 quotes at the end of the line instead of 3. So the first 3 close the long quote and then the 4th opens a new quote which doesn't get closed.<br> </div><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div><div class="h5">
--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</div></div></blockquote></div><br>