Python and win32api

Samuel Schulenburg samschul at pacbell.net
Wed Oct 17 16:47:13 EDT 2001


olav.viken at kmss.no wrote in message news:<9qk64l$i3e$1 at oslo-nntp.eunet.no>...
> 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
See the following URL for Sam Rushing's CALLDLL module that is part of
Windll. There is a version for Python 2.1

http://www.nightmare.com/software.html

Also get Dynwin at this URL 
"http://www.nightmare.com/~rushing/dynwin/" for support functions.

Sam Schulenburg



More information about the Python-list mailing list