How to get version of Windows?

Eric Brunel eric.brunel at pragmadev.com
Thu Dec 12 06:05:21 EST 2002


Gerhard Haring wrote:

> Eric Brunel <eric.brunel at pragmadev.com> wrote:
>> Hi all,
>> 
>> Maybe I'm missing something obvious here, but I searched a lot around and
>> couldn't find anything. I'd like to know the version of Windows I'm
>> running on from a Python program. How can I do that? AFAIK, sys.platform,
>> os.name and related stuff always return the same thing on any Windows
>> flavor.
>> 
>> To be more precise, what I need to know is the Windows "lineage":
>> Win95/98/Me or WinNT/2k/XP. Any clue on a secure way to do that?
> 
> With http://www.lemburg.com/files/python/platform.py
> 
> Check out platform.win32_ver() there.

Works like a charm. Thanks a lot!
-- 
- Eric Brunel <eric.brunel at pragmadev.com> -
PragmaDev : Real Time Software Development Tools - http://www.pragmadev.com



More information about the Python-list mailing list