Python and win32api

olav.viken at kmss.no olav.viken at kmss.no
Wed Oct 17 10:55:17 EDT 2001


This is what i'm trying to do with a simple Python script:

- Retrive the operating system on the computer the script is running
- Retrive the service pack installed 
- Retrive the native language of the OS installed. 

The first two is easy, but last one is giving me problems. 

This is from Microsoft knowledgebase

HOWTO: Determine Default Language ID of Windows 95 or WinNT
http://support.microsoft.com/support/kb/articles/q181/6/04.asp

Which says in part:
| SUMMARY
| Some applications need to get the operating system's language ID. 
| GetSystemDefaultLangID doesn't work, because the user can change it 
| in the Control Panel.  [...]
| Under both Windows NT and Windows 95, you can get the language 
| information in the FileVersionInfo of User.exe by calling 
| GetFileVersionInfo, and then VerQueryValue (on 
\\VarFileInfo\\Translation") 
| on the VersionInfo block of the operating system's User.exe. 
| NOTE: This method is the most reliable. It works well under both Windows 

| NT and Windows 95. This method also works for Windows 3.1. 

I can't find the GetFileVersionInfo method under win32api, and I can't find another way of telling the language.


Anyone?

Thanks
Olav





More information about the Python-list mailing list