[clug] Encoding

Chris Smart clug at christophersmart.com
Tue Dec 29 07:56:55 UTC 2015


On 29/12/15 18:22, Adrian wrote:
> adrian at adrian-TravelMate-6293:~/thought.treasure/python$ python tt.py
>   File "tt.py", line 144
> SyntaxError: Non-ASCII character '\xae' in file tt.py on line 144, but
> no encoding declared; seehttp://python.org/dev/peps/pep-0263/
> <http://python.org/dev/peps/pep-0263/>for details

Do you have a shebang on the first line, like this?
 #!/usr/bin/env python

You can try specifying the encoding by adding a line like so:
    #!/usr/bin/env python
    # -*- coding: utf-8 -*-

-c

-- 
  _
 °v°
/(_)\
 ^ ^



More information about the linux mailing list