How to find out operating system

Lawrence Hudson lhudson at geminidataloggers.com
Thu Jun 27 11:19:21 EDT 2002


If you have PyWin32, try this:

d:\>python
Python 2.0 (#8, Jun 12 2002, 10:20:16) [MSC 32 bit (Intel)] on win32
Type "copyright", "credits" or "license" for more information.
 >>> import win32api
 >>> win32api.GetVersionEx()
(5, 0, 2195, 2, 'Service Pack 2')
 >>>

majorVersion:   Identifies the major version number of the operating system.
minorVersion:   Identifies the minor version number of the operating system.
buildNumber:    Identifies the build number of the operating system in 
the low-order word. (The high-order word contains the major and minor 
version numbers.)
platformId:     Identifies the platform supported by the operating 
system.  May be one of VER_PLATFORM_WIN32s, VER_PLATFORM_WIN32_WINDOWS 
or VER_PLATFORM_WIN32_NT
version:        Contains arbitrary additional information about the 
operating system.

Thanks,
Lawrence


A wrote:
> Hi,
> What is the best way of  finding out the kind operating system?
> I can use os.name but if the system is Windows I would like also 
> know if the system is Windows98 or Windows ME or W2K or 
> Windows XP.
> Thanks for help.
> Ladislav
> 
> 
> 
> 





More information about the Python-list mailing list