python3 - the hardest hello world ever ?

Helmut Jarausch jarausch at igpm.rwth-aachen.de
Wed Oct 15 06:10:31 EDT 2008


Ben Finney wrote:
> Helmut Jarausch <jarausch at skynet.be> writes:
> 
>> I have to set an internal property (with leading underscore)
>> for each output file I'm using - right?
> 
> If you're referring to the source encoding declaration: No,
> underscores have no effect. The specification is at
> <URL:http://www.python.org/doc/2.5.2/ref/encodings.html>.
> 
>> #!/usr/local/bin/python3.0
>> # _*_ coding: latin1 _*_
> 
> I'm not sure why you use underscores in this line. The usual form is
> to use a mode line as recognised by Emacs::
> 
>     # -*- coding: latin1 -*-
> 
> or Vim::
> 
>     # vim: fileencoding=latin1 :
> 

No, I meant the underscore in sys.stdout._encoding='latin1'
                                          ^

As for the source encoding, I have used the underscore version
which seems to work, as well.

Thanks,
Helmut.


-- 
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany



More information about the Python-list mailing list