摘要:
一般性的python不支持中文字符,就算是注释都不行,
但是,注意但是……..
1.python中的中文字符问题.
当然了是因为编码问题,细节内容可查看:
https://www.python.org/dev/peps/pep-0263/
人家发现问题了,然后也给出了解决方法(你可以设定你的代码的编码方式):
> Defining the Encoding
> Python will default to ASCII as standard encoding if no other
> encoding hints are given.
> ***To define a source code encoding, a magic comment must
> be placed into the source files either as first or second
> line in the file, such as:***
> # coding=<encoding name>
> or (using formats recognized by popular editors)
> #!/usr/bin/python
> # -*- coding: <encoding name> -*-
>