python 常用资源与问题
常见问题一:
在源文件中有中文注释,运行出错解决之法。 ----------- c:\>python test-1.py sys:1: DeprecationWarning: Non-ASCII character '\xd7' in file test-1.py on line2, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details 你好,世界!
----------- 去 http://www.python.org/peps/pep-0263.html 找到答案。 在文件的首行加上 #!/usr/bin/python # -*- coding: <encoding name> -*- 这样就好了。 我用的是gb2312,在windows 98 se 下。 <encoding name>由gb2312 代替即可。
网站: python.cn 及其新闻组 smth.org 水木清华 python版 linuxforum.net python版 
|