Differentiating between WinNT and Win32

Alex Martelli alex at magenta.com
Mon Jun 26 10:07:36 EDT 2000


Jerome Chan <eviltofu at rocketmail.com> wrote in message
news:eviltofu-F9E289.07322926062000 at news.earthlink.net...
> Is there a way to do this in Python? I went DejaDiving and found
> something called platform.py but the link to it on starship is dead.
> Anyone has any clues?

>>> from win32api import GetVersionEx
>>> GetVersionEx()
(4, 0, 1381, 2, 'Service Pack 5')

The 4th element in the tuple ("2" here) has the specific info
you require; it's 1 for Win/95 and Win/98, 2 for Win/NT (note
that all of these are "Win32"...).


Alex






More information about the Python-list mailing list