Charles Brunet
Charles Brunet

Reputation: 23120

How to set Python default locale on Windows?

I know I change change the locale for an application using

import locale
locale.setlocale(locale.LC_ALL, '')

Documentation says default value for locale usually comes from LANG environment variable. However, on Windows platform, it seems to be different. Where does Python takes the default value for locale? Is there a way to change this default value for all my Python scripts?

Upvotes: 2

Views: 5858

Answers (2)

kjp
kjp

Reputation: 3116

The default system locale for a windows system can be set via the control panel. Python uses this default locale when you call setlocale with '' as the second argument. See here on how to change the default locale.

Upvotes: 2

Scorpil
Scorpil

Reputation: 1526

It is the value you've set in Control Panel.

Upvotes: 0

Related Questions