Ross Burton wrote:
> On Sat, 2005-02-12 at 13:18 +0100, Frederic Peters wrote:
> > [EMAIL PROTECTED]:~$ python -c 'print "hello world"'
> >   File "<string>", line 1
> >     print "hello world"
> >          ^
> > SyntaxError: invalid syntax
> 
> Don't you need to tell Python what charset you are using if you don't
> use ASCII?

This is PEP 263 <http://www.python.org/peps/pep-0263.html>, its
purpose is to declare the encoding of Python source files but it
actually only applies to strings, not to the code itself.

[EMAIL PROTECTED]:~$ cat test.py 
# -*- coding: UTF-8 -*-
print 'Hello world'

[EMAIL PROTECTED]:~$ python test.py 
  File "test.py", line 2
    print 'Hello world'
         ^
SyntaxError: invalid syntax




        Frederic


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to