Life is short, you need Python

Python 之 error:Non-ASCII character '\xa1'

SyntaxError: Non-ASCII character '\xa1' in file test.py on line 27, but no encod
ing declared; see http://www.python.org/peps/pep-0263.html for details

 

Fixed by add the following lines in header of .py file

 

#! /usr/bin/env python
#
-*- coding:utf-8 -*-

 

posted @ 2010-09-09 14:54  runfox545  阅读(2143)  评论(0)    收藏  举报
白月黑羽 Python教程 白月黑羽Python