Re: python3 - the hardest hello world ever ?

2008-10-24 Thread henning . vonbargen
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

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Ross Ridge
Helmut Jarausch [EMAIL PROTECTED] 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

Re: python3 - the hardest hello world ever ?

2008-10-17 Thread Helmut Jarausch
Ross Ridge wrote: Helmut Jarausch [EMAIL PROTECTED] 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

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Martin v. Löwis wrote: What defines me as latin1-user? That your locale is based on Latin-1, e.g. because it is a German locale. How precisely that works depends on the operating system. So my system seems to be an ASCII system? At least that's what Python determined. If Python couldn't

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Martin v. Löwis
Still, I wished it were possible call sys.setdefaultencoding at the very beginning of a script. Why isn't that possible? The default encoding was used when combining byte-oriented text and unicode-oriented text. Such combination is no longer supported, hence the notion of a default encoding

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Martin v. Löwis wrote: Still, I wished it were possible call sys.setdefaultencoding at the very beginning of a script. Why isn't that possible? The default encoding was used when combining byte-oriented text and unicode-oriented text. Such combination is no longer supported, hence the notion

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Paul Boddie
On 16 Okt, 11:28, Helmut Jarausch [EMAIL PROTECTED] wrote: I meant setting the default encoding which is used by print (e.g.) when outputting the internal unicode string to a file. As far as I understood, currently I am fixed to setting either the 'locale' or to switch settings for each

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Helmut Jarausch
Paul Boddie wrote: On 16 Okt, 11:28, Helmut Jarausch [EMAIL PROTECTED] wrote: I meant setting the default encoding which is used by print (e.g.) when outputting the internal unicode string to a file. As far as I understood, currently I am fixed to setting either the 'locale' or to switch

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Martin v. Löwis
I meant setting the default encoding which is used by print (e.g.) when outputting the internal unicode string to a file. Having such a thing would be conceptually wrong. What encoding should be used depends on the file - different files may have different encodings. When opening a file, you

Re: python3 - the hardest hello world ever ?

2008-10-16 Thread Terry Reedy
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.

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Ben Finney wrote: Helmut Jarausch [EMAIL PROTECTED] 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

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Paul Boddie
On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED] wrote: What defines me as latin1-user? What does sys.stdout.encoding say? In Python 2.x, at least, that attribute should reflect the capabilities of your environment (specifically, the character encoding) and help determine whether it makes

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Paul Boddie wrote: On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED] wrote: What defines me as latin1-user? What does sys.stdout.encoding say? In Python 2.x, at least, that It says ansi_x3.4-1968 Where can I change this? attribute should reflect the capabilities of your environment

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Paul Boddie
On 15 Okt, 17:59, Helmut Jarausch [EMAIL PROTECTED] wrote: Paul Boddie wrote: What does sys.stdout.encoding say? In Python 2.x, at least, that It says  ansi_x3.4-1968 That's ASCII, yes. Where can I change this? What's your locale? I can provoke the same setting if I run a Python program

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Diez B. Roggisch
Helmut Jarausch wrote: Paul Boddie wrote: On 15 Okt, 12:08, Helmut Jarausch [EMAIL PROTECTED] wrote: What defines me as latin1-user? What does sys.stdout.encoding say? In Python 2.x, at least, that It says ansi_x3.4-1968 Where can I change this? By changing your console's terminal

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Orestis Markou
I would just use UTF-8 and be done with it. Set your editor to write UTF-8 files, set the correct #coding at your python script, make sure your terminal supports outputting UTF-8 characters (and your font has the correct glyphs) and everything should be fine. No trickery required. Even

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Martin v. Löwis wrote: do I miss something (I do hope so) or is switching to Python3 really hard for Latin1-users? Why do you want to switch? sys.stdout.encoding should already be iso-8859-1, if you are a Latin1-user. What defines me as latin1-user? commenting #

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Helmut Jarausch
Brian Quinlan wrote: Hey Helmut, Did you try just: print(Hallo, Süßes Python) Yes, but that doesn't work here. Please see my reply to Martin's reply. Thanks, Helmut. -- Helmut Jarausch Lehrstuhl fuer Numerische Mathematik RWTH - Aachen University D 52056 Aachen, Germany --

Re: python3 - the hardest hello world ever ?

2008-10-15 Thread Martin v. Löwis
What defines me as latin1-user? That your locale is based on Latin-1, e.g. because it is a German locale. How precisely that works depends on the operating system. So my system seems to be an ASCII system? At least that's what Python determined. If Python couldn't have found out that you

python3 - the hardest hello world ever ?

2008-10-14 Thread Helmut Jarausch
Hi, do I miss something (I do hope so) or is switching to Python3 really hard for Latin1-users? My simplest hello world script - which uses a few German umlaut characters - doesn't look very intuitive. I have to set an internal property (with leading underscore) for each output file I'm using -

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread pjacobi . de
Hi Helmut, All, do I miss something (I do hope so) or is switching to Python3 really hard for Latin1-users? It's as complicated as ever -- if you have used unicode strings in the past (as the 3.0 strings now are always unicode strings). # sys.setfilesystemencoding('latin1') This cares about

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread Martin v. Löwis
do I miss something (I do hope so) or is switching to Python3 really hard for Latin1-users? Why do you want to switch? sys.stdout.encoding should already be iso-8859-1, if you are a Latin1-user. Regards, Martin -- http://mail.python.org/mailman/listinfo/python-list

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread Brian Quinlan
Hey Helmut, Did you try just: print(Hallo, Süßes Python) Cheers, Brian Helmut Jarausch wrote: Hi, do I miss something (I do hope so) or is switching to Python3 really hard for Latin1-users? My simplest hello world script - which uses a few German umlaut characters - doesn't look very

Re: python3 - the hardest hello world ever ?

2008-10-14 Thread Ben Finney
Helmut Jarausch [EMAIL PROTECTED] 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