On Apr 17, 5:54 pm, "Penny Y." <[EMAIL PROTECTED]> wrote:
>  I saw some scripts have a line at its begin:
>
> # encoding:gb2312
>
> what's this? Why need it? thanks.

declaring of the encoding used in the source file.
it's like <meta http-equiv="Content-type" content="text/html;
charset=gb2312" /> in html

take gb2312 as an example.
you will need it if you have some chinese char in the source file
which uses gb2312 for the file encoding.
if not, you might get an error like:  SyntaxError: Non-ASCII
character .........
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to