Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #91185

Re: programmatically change windows regional settings?

Path csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <fomcl@yahoo.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.012
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'ideally': 0.04; 'preferably': 0.05; '(of': 0.07; 'locale': 0.07; 'override': 0.07; 'url:msdn': 0.07; '(actually': 0.09; 'lang': 0.09; 'python': 0.11; '"this': 0.13; '(but': 0.15; "'');": 0.16; '24,': 0.16; '3.3,': 0.16; '>on': 0.16; 'pypy.': 0.16; 'registry': 0.16; 'subject:windows': 0.16; 'unittests': 0.16; 'wrote:': 0.16; 'language': 0.19; 'settings': 0.20; 'windows': 0.20; 'portion': 0.20; 'thanks.': 0.22; 'affects': 0.22; 'lawrence': 0.22; 'to:2**1': 0.22; '2015': 0.23; 'tried': 0.24; 'import': 0.24; 'to:no real name:2**1': 0.27; 'appear': 0.29; 'cest': 0.29; 'helpful.': 0.29; 'print': 0.31; 'url:mailman': 0.31; 'run': 0.32; 'probably': 0.32; 'language.': 0.32; 'possibly': 0.32; 'url:python': 0.33; 'windows.': 0.33; 'another': 0.34; 'thanks!': 0.34; 'subject:?': 0.34; 'server': 0.34; "i'll": 0.34; 'url:listinfo': 0.35; 'to:addr:python-list': 0.35; 'subject:skip:p 10': 0.35; 'list': 0.35; 'asking': 0.35; 'but': 0.36; 'url:org': 0.36; 'statement': 0.36; 'url:library': 0.36; 'hi,': 0.37; 'setting': 0.37; 'subject:: ': 0.37; 'charset:us-ascii': 0.37; 'ok,': 0.37; 'skip:g 20': 0.37; 'skip:- 20': 0.37; 'rather': 0.38; 'version': 0.38; 'does': 0.39; 'url:microsoft': 0.39; 'to:addr:python.org': 0.39; 'easily': 0.39; 'mark': 0.40; 'hope': 0.61; 'more': 0.62; 'regional': 0.63; 'french': 0.64; 'goal': 0.64; 'our': 0.64; 'importantly,': 0.66; 'python-list': 0.66; 'url :en-us': 0.66; 'received:98.137': 0.67; 'received:98.136': 0.70; 'received:gq1.yahoo.com': 0.72; 'received:mail.gq1.yahoo.com': 0.72; 'sounds': 0.72; 'pythonistas,': 0.84; 'received:bullet.mail.gq1.yahoo.com': 0.84; 'route': 0.84; 'to:addr:yahoo.co.uk': 0.84; 'lucky': 0.93; 'panel.': 0.93
X-Yahoo-Newman-Property ymail-3
X-Yahoo-Newman-Id 611324.43705.bm@omp1039.mail.gq1.yahoo.com
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1432476980; bh=yHNRwGO7Q1EtCE2tlJ0cbOyS2QUDS/8zz6Rg7QS6TqE=; h=Message-ID:Date:From:Subject:To:MIME-Version:Content-Type; b=S1h36WXY91/LGDYv0QKQqXLT4y5mVV35m2qaP/KXRenql1k9AjRbTwdui7oCaIcJ8wLFHTG/ftAoLuWwPFh+5BvKP8pXSTSKJa7jGgW4bQMcNqSOXd7nsuItniis5ysudgTYyu9haPn68vNrMIUDwFxMuuaAwBsBqz0TW+/ysaM=
X-YMail-OSG 2OLtGXQVM1laPmGweG9Dce1pHAuhuyz73oQ09onwVv428Z_ ISTTEu8XOjRTPZ90gD7wyjLC9G8sy0FVHmB5uzVB_eS.JwGZIBJqOfZ8ADw0 kUScSRIB1XnrpGI1Don5Pyt19oKnKZ1244X1gqrtvpZW7gprNoe_Ba8J9dJq 9qa.c9pI6N1IOQaOGQnEmUh6kk30zHGC7IUFV.Rz_krWCJocgO2Tt8N95.fO W6wtvhzNHa7lQal7MpjupwuUcBBXUcn6PIePh0P0Ht6947FYX3jM_uJ1p8G6 uNcGLRLr0y66GxoIIOmcpf2M0hBQfEp2E7AXak1wGarAiN0z7sHV8tk_07Bx iGqiYgptbMHxSU4z6eUm800rPUHAUwD5f84US68ybWvXgjHUP9gqA6ISk5vv bV_PNmU.mtNIAoclAFU5fccE0IOY0KdReLOPIVkc9lN1Xx_9XUMgV0yzvX3b Aq5tkj2Q5WACXMO_dRof9QOw1KZnq.4X9y826i.4ov1skYci3XHrYcVpe_rR ozWdWy99l7Qsrl6HUIUszNjn.n28DmtnQ_j5x9N3ez4cTeLLzGGKNeJ8V5r9 cwQ--
X-Rocket-MIMEInfo 002.001, Ci0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tDQpPbiBTdW4sIE1heSAyNCwgMjAxNSAzOjA3IFBNIENFU1QgTWFyayBMYXdyZW5jZSB3cm90ZToNCg0KPk9uIDI0LzA1LzIwMTUgMTM6NTAsIEFsYmVydC1KYW4gUm9za2FtIHZpYSBQeXRob24tbGlzdCB3cm90ZToNCj4.DQo.PiBIaSwNCj4.DQo.PiBJbiBXaW5kb3dzIEkgY2FuIGNoYW5nZSB0aGUgcmVnaW9uYWwgc2V0dGluZ3MgbWFudWFsbHkgaW4gdGhlIGNvbnRyb2wgcGFuZWwuIEJ1dCBob3cgZG8gSSBkbyB0aGlzIHByb2dyYW1tYXRpY2FsbHk_IEkBMAEBAQE-
X-Mailer YahooMailWebService/0.8.203.740
Date Sun, 24 May 2015 07:16:20 -0700
From Albert-Jan Roskam <fomcl@yahoo.com>
Subject Re: programmatically change windows regional settings?
To breamoreboy@yahoo.co.uk, python-list@python.org
MIME-Version 1.0
Content-Type text/plain; charset=us-ascii
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.20+
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.22.1432476990.5151.python-list@python.org> (permalink)
Lines 52
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1432476990 news.xs4all.nl 2911 [2001:888:2000:d::a6]:42814
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:91185

Show key headers only | View raw


-----------------------------
On Sun, May 24, 2015 3:07 PM CEST Mark Lawrence wrote:

>On 24/05/2015 13:50, Albert-Jan Roskam via Python-list wrote:
>>
>> Hi,
>>
>> In Windows I can change the regional settings manually in the control panel. But how do I do this programmatically? I tried setting LANG but this does not work in Windows.
>>
>> Kernel32's SetLocaleInfo sounds promising, but "This setting only affects the user override portion of the locale settings; it does not set the system defaults." https://msdn.microsoft.com/en-us/library/ee491893(v=winembedded.60).aspx
>>
>> Another route might be _winreg (but that's probably more brittle and, more importantly, the registry sucks)
>>
>> My goal is to easily run my unittests in a number of locales (actually a platform x locale x python version matrix)
>>
>> Thanks!
>>
>> Albert-Jan
>>
>
>You're probably better off asking this on 
>https://mail.python.org/mailman/listinfo/python-win32 which is also 
>available as gmane.comp.python.windows, although you might get lucky 
>here.  

Ok, I'll check that out, thanks. Hope that list is about more than win32com

If you do a rather more specific statement than "this does not 
>work in Windows" would be helpful. 

One can set LANG in Windows (of course), but Windows does not appear to ever use it. So it's pointless.
setx LANG France.French.1252 && python -c "from locale import *; setlocale(LC_ALL, ''); print(getlocale())" 

... Does not print a French locale on my non-French system 

>Your Python and Windows version(s) 
>might possibly assist as well :)


Windows Server 2012 R2 (x64), and preferably also Win 7 x64. Python 2.7, 3.3, 3.4, and ideally also pypy.


>-- 
>My fellow Pythonistas, ask not what our language can do for you, ask
>what you can do for our language.
>
>Mark Lawrence
>
>-- 
>https://mail.python.org/mailman/listinfo/python-list

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: programmatically change windows regional settings? Albert-Jan Roskam <fomcl@yahoo.com> - 2015-05-24 07:16 -0700

csiph-web