MiscItems/2008-11-19

多行注释编码问题

现象

2008/11/18 yangyi <[email protected]>:

> 在python中大家是如何使用多行注释和中文注释的。比如C语言中的
> /*
> int a
> int b
> */
>
> 还有注释中用中文就报错,大家遇到过这种情况吗?

应对

马踏飞燕 <[email protected]>
reply-to        [email protected]
to      [email protected]
date    Wed, Nov 19, 2008 at 09:47
subject [CPyUG:71721] Re: python注释问题

多行中文注释可以直接指定unicode。

u"""
中俄文
中俄文
中俄文
中俄文
"""

这样就不会出错了。


反馈

创建 by -- ZoomQuiet [2008-11-19 01:52:18]

MiscItems/2008-11-19 (last edited 2009-12-25 07:15:56 by localhost)