Lawrence D’Oliveiro於 2018年1月1日星期一 UTC+8上午7時56分02秒寫道:
> On Sunday, December 31, 2017 at 11:04:19 PM UTC+13, jf...@ms4.hinet.net wrote:
> >
> > This answer makes me think about '\' more thoughtful:-)
>
> Python generating HTML containing JavaScript which generates HTML:
>
> out.write \
>
Random832於 2017年12月31日星期日 UTC+8下午1時25分50秒寫道:
> On Sat, Dec 30, 2017, at 23:57, jf...@ms4.hinet.net wrote:
> > I have a multiline string, something like '''...\nf.write('\n')\n...'''
> > when pass to exec(), I got
> > SyntaxError: EOL while scanning string literal
> >
> > How to get rid of it?
>
On Sat, Dec 30, 2017, at 23:57, jf...@ms4.hinet.net wrote:
> I have a multiline string, something like '''...\nf.write('\n')\n...'''
> when pass to exec(), I got
> SyntaxError: EOL while scanning string literal
>
> How to get rid of it?
Use \\n for this case, since you want the \n to be
I have a multiline string, something like '''...\nf.write('\n')\n...'''
when pass to exec(), I got
SyntaxError: EOL while scanning string literal
How to get rid of it?
Best Regards,
Jach Fong
--
https://mail.python.org/mailman/listinfo/python-list