[Tutor] Python for Windows: module re, re.LOCALE different fo r Idle and p ython shell?

Steve lonetwin at gmail.com
Thu Jul 29 15:20:25 CEST 2004


Hi Ralf,

On Thu, 29 Jul 2004 13:22:11 +0200, Steckel, Ralf
<ralf.steckel at atosorigin.com> wrote:
> thanx for your suggestion (what actually made me to improve my script by
> opening the file via codecs), but this doesn't fix the problem.

You are welcome.

<...snip...>
> By using the codecs.open with encoding = 'iso-8859-1' my basic problem (re
> doesn't recognize German Umlaute as valid characters in re in Python shell)
> still exists.

    Oh ok. Well unfortunately, I am reading this using the gmail web
interface and I ran your script on my linux box, and so I can't
reproduce the behaviour that you are experiencing.
    In any case, this seems to be (like you, yourself mentioned) a
problem with the environment rather than with python, so here's
another shot in the dark. ....have you considered setting a default
locale for the script by using the 'locale' module ??

ie: 
import locale 
locale.setlocale(locale.LC_ALL, 'de_DE')
<the rest of your program>


HTH
Steve


More information about the Tutor mailing list