Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > python3 - the hardest hello world ever ?

Reply
Thread Tools

python3 - the hardest hello world ever ?

 
 
Terry Reedy
Guest
Posts: n/a
 
      10-17-2008
Helmut Jarausch wrote:

> I have always worked with latin-1 strings with an US locale under
> python-2.x with x < 6 (I haven't tried 2.6, though). I hope to switch to
> 3.0 as soon as possible.


Having the luxury of not needing 3rd party extensions for my current
work, I already have, and love it.

A few month ago I still thought I had no personal need for Unicode.
Then my daughter announced that she wanted to learn Japanese. My mind
was changed.

We will all be happier, I think, when output devices routinely accept
UTF-8 streams and display the full current Unicode character set.

tjr



 
Reply With Quote
 
 
 
 
Ross Ridge
Guest
Posts: n/a
 
      10-17-2008
Helmut Jarausch <> wrote:
># but this ugly one (to be done for each output file)
>sys.stdout._encoding='latin1'


Is this writable "_encoding" attribute, with a leading underscore (_),
documented anywhere? Does it actually work? Would it happen to be
supported in 2.5 or 2.6? The fact that I can't change the encoding
attribute of sys.stdout/stderr/stdin has caused problems for me in
the past.

Ross Ridge

--
l/ // Ross Ridge -- The Great HTMU
[oo][oo]
-()-/()/ http://www.csclub.uwaterloo.ca/~rridge/
db //
 
Reply With Quote
 
 
 
 
Helmut Jarausch
Guest
Posts: n/a
 
      10-17-2008
Ross Ridge wrote:
> Helmut Jarausch <> wrote:
>> # but this ugly one (to be done for each output file)
>> sys.stdout._encoding='latin1'

>
> Is this writable "_encoding" attribute, with a leading underscore (_),
> documented anywhere? Does it actually work? Would it happen to be
> supported in 2.5 or 2.6? The fact that I can't change the encoding
> attribute of sys.stdout/stderr/stdin has caused problems for me in
> the past.
>


Yes, it does work in python-3.



--
Helmut Jarausch

Lehrstuhl fuer Numerische Mathematik
RWTH - Aachen University
D 52056 Aachen, Germany
 
Reply With Quote
 
henning.vonbargen@arcor.de
Guest
Posts: n/a
 
      10-24-2008
> Many thanks, it works when setting the LANG environment variable.

BTW:
For Windows users, when running Python command-line programs,
you can also modify the properties of the "cmd.exe" window and
tell windows to use the TT Lucida Console font instead of the raster
font.

Then, before starting the Python program, do a
CHCP 1252
This way the sys.stdout.encoding will be cp1252
(tested with Python 2.4.3 and 2.5.1).
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
regular expression to parse {"hello", "hello world","1hello-2*hello"} Roy Java 6 01-07-2008 08:06 PM
to print in the reverse order, ("Hello World" -> "World Hello") vijay C Programming 8 04-26-2005 02:11 AM
Re: The worst 'hello world' example ever written... C C++ 424 10-09-2003 08:57 AM
Re: The worst 'hello world' example ever written... Greg Comeau C++ 1 09-29-2003 04:15 PM
Re: The worst 'hello world' example ever written... The Saqe C++ 2 09-24-2003 02:23 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57