[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


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



More information about the Tutor mailing list