473,499 Members | 1,886 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Get the current language of the machine

1 New Member
hi wanna get the language of the machine with python so depending of the default languge my application know what command it should run
Feb 20 '11 #1
2 4311
dwblas
626 Recognized Expert Contributor
$LANG is the environment variable used by most distros, but how it is stored is certainly distro specific. You might also take a look at the builtin os module as a place where it might be stored.
Feb 20 '11 #2
bvdet
2,851 Recognized Expert Moderator Specialist
You can get the language code and character encoding with locale.getdefaultlocale(). On my windows machine, it returns: ('en_US', 'cp1252')
Feb 20 '11 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
1720
by: William Korvine | last post by:
I have been Googling (and still am), but thought I'd just ask. I have an application that needs a scripting language. I have written my own interpreted language (a small subset of C++), but am...
2
1258
by: Dannie Chan | last post by:
Hi, I try to create a new application from VB.NET. Bottoms, text and output will show both english and Chinese. Should I use Chinese version or I still use English verion? If I use English...
6
4152
by: Wiktor Zychla | last post by:
I've downloaded the polish language pack for .Net Framework 1.1 and I've installed it. Now I expect to see any exception messages in my native language but I still get english texts in exception...
41
3367
by: Mountain Bikn' Guy | last post by:
What is the current preferred way to save user preferences in dotnet? Is the registry the right place to do this? Can anyone recommend a good article (or book) for this topic? Thanks.
4
7454
by: Gidi | last post by:
Hi, my user default language is hebrew but in some cases i want that the default language in specific textBox will be english (i mean that when the user will hit the 'T' key he will get a T in...
4
2858
by: Peter | last post by:
Hi! I'm developing components (webparts) for a sharepoint site and are currently having some problems with the resource manager. The site supports two languages (English and Swedish) and when...
3
6134
by: Nick | last post by:
VB.Net allows the ability to find the path of special folders by calling the System.Environment.GetFolderPath function with a parameter specifying which special folder I want the path of. ...
4
2102
by: walter | last post by:
The question sound simple -- I had a multilingual site, I give a button on each page to allow user switch to different language, and of cause I want to use asp.net 2 globalization mechanism. So...
5
4317
by: Cylix | last post by:
Is there any existing method in VB.NET or any 3-third party function can find out the language in a string? Let say, isChinese? isFrench?
1
2624
by: shine1lytskin28 | last post by:
Write "o" write "r" write "e" write "g" write "o" write "n" .end
0
7131
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6894
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.