[Tutor] Python for Windows: module re, re.LOCALE different fo r Idle and p ython shell? (original) (raw)
Alan Gauld alan.gauld at blueyonder.co.uk
Thu Jul 29 23:03:10 CEST 2004
- Previous message: [Tutor] Python for Windows: module re, re.LOCALE differen t fo r Idle and p ython shell?
- Next message: [Tutor] Simple chat server?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
In Idle 'loc=locale.getlocale(locale.LCCTYPE)' prints '['deDE', '1252']'. In python shell 'loc=locale.getlocale(locale.LCCTYPE)' prints '(None,None)'.
I don't think DOS is Locale aware, it uses a concept called codepages to select laguages and that requires a whole new technique to find the right characters.
I think this is one of those places where you have to check the OS version and have an if OS == DOS branch in your code. :-(
Alan G
- Previous message: [Tutor] Python for Windows: module re, re.LOCALE differen t fo r Idle and p ython shell?
- Next message: [Tutor] Simple chat server?
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]